-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.11.0' into versions
- Loading branch information
Showing
56 changed files
with
2,932 additions
and
2,973 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,109 +2,36 @@ name: CI | |
|
||
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: Export latest tool versions | ||
run: | | ||
latest_version() { | ||
curl --silent "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | ||
} | ||
echo "ANYLINT_LATEST_VERSION=$( latest_version Flinesoft/AnyLint )" >> $GITHUB_ENV | ||
echo "SWIFT_SH_LATEST_VERSION=$( latest_version mxcl/swift-sh )" >> $GITHUB_ENV | ||
- name: AnyLint Cache | ||
uses: actions/cache@v1 | ||
id: anylint-cache | ||
with: | ||
path: anylint-cache | ||
key: ${{ runner.os }}-v1-anylint-${{ env.ANYLINT_LATEST_VERSION }}-swift-sh-${{ env.SWIFT_SH_LATEST_VERSION }} | ||
|
||
- name: Copy from cache | ||
if: steps.anylint-cache.outputs.cache-hit | ||
run: | | ||
sudo cp -f anylint-cache/anylint /usr/local/bin/anylint | ||
sudo cp -f anylint-cache/swift-sh /usr/local/bin/swift-sh | ||
- name: Install AnyLint | ||
if: steps.anylint-cache.outputs.cache-hit != 'true' | ||
run: | | ||
git clone https://github.com/Flinesoft/AnyLint.git | ||
cd AnyLint | ||
swift build -c release | ||
sudo cp -f .build/release/anylint /usr/local/bin/anylint | ||
- name: Install swift-sh | ||
if: steps.anylint-cache.outputs.cache-hit != 'true' | ||
run: | | ||
git clone https://github.com/mxcl/swift-sh.git | ||
cd swift-sh | ||
swift build -c release | ||
sudo cp -f .build/release/swift-sh /usr/local/bin/swift-sh | ||
- name: Copy to cache | ||
if: steps.anylint-cache.outputs.cache-hit != 'true' | ||
run: | | ||
mkdir -p anylint-cache | ||
cp -f /usr/local/bin/anylint anylint-cache/anylint | ||
cp -f /usr/local/bin/swift-sh anylint-cache/swift-sh | ||
pull_request: | ||
branches: [main] | ||
|
||
- name: Cleanup checkouts | ||
run: rm -rf AnyLint && rm -rf swift-sh | ||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
- name: Run AnyLint | ||
run: anylint | ||
|
||
jobs: | ||
swiftlint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout Source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run SwiftLint | ||
uses: norio-nomura/action-swiftlint@3.1.0 | ||
uses: norio-nomura/action-swiftlint@3.2.1 | ||
with: | ||
args: --strict | ||
|
||
test-linux: | ||
runs-on: ubuntu-latest | ||
ci: | ||
runs-on: macos-latest | ||
needs: swiftlint | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Checkout Source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run tests | ||
run: swift test -v | ||
|
||
test-macos: | ||
runs-on: macos-11 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Run tests | ||
run: swift test -v --enable-code-coverage | ||
|
||
- name: Report Code Coverage | ||
run: | | ||
xcrun llvm-cov export -format="lcov" .build/debug/${PACKAGE_NAME}PackageTests.xctest/Contents/MacOS/${PACKAGE_NAME}PackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov | ||
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.lcov | ||
env: | ||
PACKAGE_NAME: AnyLint | ||
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
run: swift test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version: 1 | ||
builder: | ||
configs: | ||
- documentation_targets: [AnyLint] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,37 @@ | ||
// swift-tools-version:5.4 | ||
// swift-tools-version:5.7 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "AnyLint", | ||
platforms: [.macOS(.v10_12)], | ||
products: [ | ||
.library(name: "AnyLint", targets: ["AnyLint", "Utility"]), | ||
.executable(name: "anylint", targets: ["AnyLintCLI"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/onevcat/Rainbow.git", from: "3.1.5"), | ||
.package(url: "https://github.com/jakeheis/SwiftCLI.git", from: "6.0.1"), | ||
], | ||
targets: [ | ||
.executableTarget( | ||
name: "AnyLintCLI", | ||
dependencies: ["Rainbow", "SwiftCLI", "Utility"] | ||
), | ||
.target( | ||
name: "AnyLint", | ||
dependencies: ["Utility"] | ||
), | ||
.target( | ||
name: "Utility", | ||
dependencies: ["Rainbow"] | ||
), | ||
.testTarget( | ||
name: "AnyLintTests", | ||
dependencies: ["AnyLint"] | ||
), | ||
.testTarget( | ||
name: "AnyLintCLITests", | ||
dependencies: ["AnyLintCLI"] | ||
), | ||
.testTarget( | ||
name: "UtilityTests", | ||
dependencies: ["Utility"] | ||
) | ||
] | ||
name: "AnyLint", | ||
platforms: [.macOS(.v10_13)], | ||
products: [ | ||
.library(name: "AnyLint", targets: ["AnyLint"]), | ||
.executable(name: "anylint", targets: ["AnyLintCLI"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/onevcat/Rainbow.git", from: "3.1.5"), | ||
.package(url: "https://github.com/jakeheis/SwiftCLI.git", from: "6.0.1"), | ||
], | ||
targets: [ | ||
.target( | ||
name: "AnyLint", | ||
dependencies: ["Utility"] | ||
), | ||
.testTarget( | ||
name: "AnyLintTests", | ||
dependencies: ["AnyLint"] | ||
), | ||
.executableTarget( | ||
name: "AnyLintCLI", | ||
dependencies: ["Rainbow", "SwiftCLI", "Utility"] | ||
), | ||
.target( | ||
name: "Utility", | ||
dependencies: ["Rainbow"] | ||
), | ||
.testTarget( | ||
name: "UtilityTests", | ||
dependencies: ["Utility"] | ||
), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.