From 71f733a9f610989105250a4e30857ab8630dd5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Sun, 15 Aug 2021 17:20:25 +0200 Subject: [PATCH] Reconfigure GitHub Actions & downgrade Swift --- .github/workflows/main.yml | 25 +---------------- .github/workflows/pull-request.yml | 45 ++++++++++++++++++++++++++++++ CHANGELOG.md | 4 +-- LICENSE | 2 +- Package.swift | 2 +- Sources/Core/Severity.swift | 1 - 6 files changed, 50 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d33c42a..7b1f7f8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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/workflow-run-cleanup-action@v0.2.2 - 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 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..19021c0 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -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/workflow-run-cleanup-action@v0.2.2 + 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b005ab..56babd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. @@ -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. diff --git a/LICENSE b/LICENSE index b1efe33..0f84aa7 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/Package.swift b/Package.swift index dfa877d..f740161 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.5 +// swift-tools-version:5.4 import PackageDescription let package = Package( diff --git a/Sources/Core/Severity.swift b/Sources/Core/Severity.swift index cca08aa..a1c07ad 100644 --- a/Sources/Core/Severity.swift +++ b/Sources/Core/Severity.swift @@ -1,5 +1,4 @@ import Foundation -import AppKit /// Defines the severity of a lint check. public enum Severity: String, CaseIterable, Codable {