Skip to content

Commit

Permalink
Cancel previous builds on GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Jun 9, 2020
1 parent 532b727 commit 3f2e658
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ on:
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

Expand All @@ -20,14 +29,14 @@ jobs:
}
echo "::set-env name=ANYLINT_LATEST_VERSION::$( latest_version Flinesoft/AnyLint )"
echo "::set-env name=SWIFT_SH_LATEST_VERSION::$( latest_version mxcl/swift-sh )"
- 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: |
Expand All @@ -49,7 +58,7 @@ jobs:
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: |
Expand Down

0 comments on commit 3f2e658

Please sign in to comment.