Skip to content

Commit

Permalink
chore: use concurrency to cancel previous CI runs (FuelLabs#2194)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlicanC authored Jul 1, 2022
1 parent a1e0dc5 commit 9a3f9ab
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,16 @@ on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
REGISTRY: ghcr.io

jobs:
cancel-previous-runs:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

build-sway-lib-core:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -40,7 +35,6 @@ jobs:
run: forc build --path sway-lib-core

build-sway-lib-std:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -58,7 +52,6 @@ jobs:
run: forc build --path sway-lib-std

build-sway-examples:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -109,7 +102,6 @@ jobs:
args: --bin examples-checker fmt --all-examples

build-mdbook:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -148,7 +140,6 @@ jobs:
fi
build-forc-test-project:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -177,7 +168,6 @@ jobs:
run: cd test-proj && forc test

cargo-build-workspace:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -195,7 +185,6 @@ jobs:
RUSTFLAGS: "-D warnings"

cargo-clippy:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -210,7 +199,6 @@ jobs:
args: --all-features --all-targets -- -D warnings

cargo-toml-fmt-check:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -226,7 +214,6 @@ jobs:
run: git ls-files | grep Cargo.toml$ | xargs --verbose -n 1 cargo-toml-lint

cargo-fmt-check:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -240,7 +227,6 @@ jobs:
args: --all -- --check

cargo-run-e2e-test:
needs: cancel-previous-runs
runs-on: ubuntu-latest
services:
fuel-core:
Expand All @@ -262,7 +248,6 @@ jobs:

# TODO: Remove this upon merging std tests with the rest of the E2E tests.
cargo-test-lib-std:
needs: cancel-previous-runs
runs-on: ubuntu-latest
services:
fuel-core:
Expand All @@ -285,7 +270,6 @@ jobs:
args: --manifest-path ./test/src/sdk-harness/Cargo.toml -- --test-threads=1 --nocapture

cargo-test-workspace:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -301,7 +285,6 @@ jobs:
args: --locked

cargo-unused-deps-check:
needs: cancel-previous-runs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -549,7 +532,7 @@ jobs:
name: Install and upload forc binaries to release
runs-on: ${{ matrix.job.os }}
if: github.event_name == 'release' && github.event.action == 'published'
needs: [cancel-previous-runs, publish]
needs: publish
strategy:
matrix:
job:
Expand Down

0 comments on commit 9a3f9ab

Please sign in to comment.