From 3f2e6583b3220096ee92a452004e58469eed5e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Tue, 9 Jun 2020 07:23:55 +0200 Subject: [PATCH] Cancel previous builds on GitHub Actions --- .github/workflows/main.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ade9501..3f545b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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/workflow-run-cleanup-action@v0.2.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + anylint: runs-on: ubuntu-latest @@ -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: | @@ -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: |