Skip to content

Commit 4076649

Browse files
committed
Reconfigure GitHub Actions & downgrade Swift
1 parent 52d6a06 commit 4076649

8 files changed

Lines changed: 56 additions & 31 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,10 @@
1-
name: CI
1+
name: Main
22

33
on:
44
push:
5-
branches: [main, versions]
6-
pull_request:
75
branches: [main]
86

97
jobs:
10-
cancel-previous-runs:
11-
runs-on: ubuntu-latest
12-
13-
steps:
14-
- name: Cancel previous runs of this workflow on same branch
15-
uses: rokroskar/workflow-run-cleanup-action@v0.2.2
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
19-
anylint:
20-
runs-on: ubuntu-latest
21-
22-
steps:
23-
- uses: actions/checkout@v2
24-
25-
- name: Install AnyLint
26-
run: brew tap Flinesoft/AnyLint https://github.com/Flinesoft/AnyLint.git && brew install anylint
27-
28-
- name: Run AnyLint
29-
run: anylint
30-
318
test-linux:
329
runs-on: ubuntu-latest
3310

.github/workflows/pull-request.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
cancel-previous-runs:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Cancel previous runs of this workflow on same branch
13+
uses: rokroskar/workflow-run-cleanup-action@v0.2.2
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
17+
anylint:
18+
runs-on: macos-latest
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Install AnyLint
24+
run: brew tap Flinesoft/AnyLint https://github.com/Flinesoft/AnyLint.git && brew install anylint
25+
26+
- name: Run AnyLint
27+
run: anylint
28+
29+
test-linux:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
35+
- name: Run tests
36+
run: swift test -v --enable-test-discovery
37+
38+
test-macos:
39+
runs-on: macos-latest
40+
41+
steps:
42+
- uses: actions/checkout@v2
43+
44+
- name: Run tests
45+
run: swift test -v --enable-code-coverage

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If needed, pluralize to `Tasks`, `PRs` or `Authors` and list multiple entries se
1919

2020
## [Unreleased]
2121
### Added
22-
- YAML-based configuration file. Supportts `FilePaths` and `FileContents` as well as `CustomScripts` for full feature parity with previous Swift-based configuration file.
22+
- YAML-based configuration file. Supports `FilePaths` and `FileContents` as well as `CustomScripts` for full feature parity with previous Swift-based configuration file.
2323
Author: [Cihat Gündüz](https://github.com/Jeehut)
2424
### Changed
2525
- Migrated from jakeheis/SwiftCLI to apple/swift-argument-parser for improved reliability & reduced maintenance.
@@ -31,7 +31,7 @@ If needed, pluralize to `Tasks`, `PRs` or `Authors` and list multiple entries se
3131
### Removed
3232
- Swift-based configuration file support removed in favor of YAML-based configuration. All features supported via the Swift file still supported via YAML file. See README.md for more details. Parameters were not renamed to keep migration simple.
3333
Author: [Cihat Gündüz](https://github.com/Jeehut)
34-
- Support for Swift versions below 5.5 was dropped to make use of the latest improvements in concurrency & SwiftPM plugin system. Use version `0.8.2` if you need to stay on lower Swift versions.
34+
- Support for Swift versions below 5.4 was dropped to make use of the latest improvements in Swift & SwiftPM. Use version `0.8.2` if you need to stay on lower Swift versions.
3535
Author: [Cihat Gündüz](https://github.com/Jeehut)
3636
### Fixed
3737
- Issues with paths due to Swift scripting not being as easy to use now fixed by moving over to YAML-based configuration. For custom scripts, responsibility is moved to the user side by allowing to specify the exact command to run.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Flinesoft (alias Cihat Gündüz)
3+
Copyright (c) 2020-2021 Flinesoft (alias Cihat Gündüz)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:5.3
22
import PackageDescription
33

44
let package = Package(
@@ -44,7 +44,7 @@ let package = Package(
4444
.product(name: "OrderedCollections", package: "swift-collections"),
4545
]
4646
),
47-
.executableTarget(
47+
.target(
4848
name: "Commands",
4949
dependencies: [
5050
"Checkers",

Sources/Commands/AnyLint.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Foundation
22
import ArgumentParser
33

4-
@main
54
/// The entry point of the toot, defines the `anylint` primary command. Sets up any sub commands like `init` or `lint`.
65
struct AnyLint: ParsableCommand {
76
static var configuration: CommandConfiguration = .init(

Sources/Commands/main.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import ArgumentParser
2+
3+
// TODO: [cg_2021-08-15] remove in favor of `@main` in AnyLint struct once GitHub has macos-11 available:
4+
// https://github.com/actions/virtual-environments/issues/2486
5+
AnyLint.main()

Sources/Core/Severity.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Foundation
2-
import AppKit
32

43
/// Defines the severity of a lint check.
54
public enum Severity: String, CaseIterable, Codable {

0 commit comments

Comments
 (0)