From 054894271df9271bd1f6e6aef7efcaaecdb49d39 Mon Sep 17 00:00:00 2001 From: Blake Mizerany Date: Fri, 26 Apr 2024 13:54:24 -0700 Subject: [PATCH] .github/workflows/test.yaml: add in-flight cancellations on new push (#3956) Also, remove a superfluous 'go get' --- .github/workflows/test.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 57867950..6a655611 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,5 +1,15 @@ name: test +concurrency: + # For PRs, later CI runs preempt previous ones. e.g. a force push on a PR + # cancels running CI jobs and starts all new ones. + # + # For non-PR pushes, concurrency.group needs to be unique for every distinct + # CI run we want to have happen. Use run_id, which in practice means all + # non-PR CI runs will be allowed to run without preempting each other. + group: ${{ github.workflow }}-$${{ github.pull_request.number || github.run_id }} + cancel-in-progress: true + on: pull_request: paths: @@ -283,7 +293,6 @@ jobs: with: go-version-file: go.mod cache: true - - run: go get - run: | case ${{ matrix.arch }} in amd64) echo ARCH=x86_64 ;;