Skip to content

Commit

Permalink
Reconfigure GitHub Actions & downgrade Swift
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Aug 15, 2021
1 parent 52d6a06 commit 4076649
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 31 deletions.
25 changes: 1 addition & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,10 @@
name: CI
name: Main

on:
push:
branches: [main, versions]
pull_request:
branches: [main]

jobs:
cancel-previous-runs:
runs-on: ubuntu-latest

steps:
- name: Cancel previous runs of this workflow on same branch
uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

anylint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install AnyLint
run: brew tap Flinesoft/AnyLint https://github.com/Flinesoft/AnyLint.git && brew install anylint

- name: Run AnyLint
run: anylint

test-linux:
runs-on: ubuntu-latest

Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Pull Request

on:
pull_request:
branches: [main]

jobs:
cancel-previous-runs:
runs-on: ubuntu-latest

steps:
- name: Cancel previous runs of this workflow on same branch
uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

anylint:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Install AnyLint
run: brew tap Flinesoft/AnyLint https://github.com/Flinesoft/AnyLint.git && brew install anylint

- name: Run AnyLint
run: anylint

test-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run tests
run: swift test -v --enable-test-discovery

test-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Run tests
run: swift test -v --enable-code-coverage
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If needed, pluralize to `Tasks`, `PRs` or `Authors` and list multiple entries se

## [Unreleased]
### Added
- YAML-based configuration file. Supportts `FilePaths` and `FileContents` as well as `CustomScripts` for full feature parity with previous Swift-based configuration file.
- YAML-based configuration file. Supports `FilePaths` and `FileContents` as well as `CustomScripts` for full feature parity with previous Swift-based configuration file.
Author: [Cihat Gündüz](https://github.com/Jeehut)
### Changed
- Migrated from jakeheis/SwiftCLI to apple/swift-argument-parser for improved reliability & reduced maintenance.
Expand All @@ -31,7 +31,7 @@ If needed, pluralize to `Tasks`, `PRs` or `Authors` and list multiple entries se
### Removed
- 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.
Author: [Cihat Gündüz](https://github.com/Jeehut)
- 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.
- 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.
Author: [Cihat Gündüz](https://github.com/Jeehut)
### Fixed
- 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.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

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

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:5.3
import PackageDescription

let package = Package(
Expand Down Expand Up @@ -44,7 +44,7 @@ let package = Package(
.product(name: "OrderedCollections", package: "swift-collections"),
]
),
.executableTarget(
.target(
name: "Commands",
dependencies: [
"Checkers",
Expand Down
1 change: 0 additions & 1 deletion Sources/Commands/AnyLint.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Foundation
import ArgumentParser

@main
/// The entry point of the toot, defines the `anylint` primary command. Sets up any sub commands like `init` or `lint`.
struct AnyLint: ParsableCommand {
static var configuration: CommandConfiguration = .init(
Expand Down
5 changes: 5 additions & 0 deletions Sources/Commands/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import ArgumentParser

// TODO: [cg_2021-08-15] remove in favor of `@main` in AnyLint struct once GitHub has macos-11 available:
// https://github.com/actions/virtual-environments/issues/2486
AnyLint.main()
1 change: 0 additions & 1 deletion Sources/Core/Severity.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import AppKit

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

0 comments on commit 4076649

Please sign in to comment.