Skip to content

Commit

Permalink
GitHub Actions: Cancel running CI jobs when commits are updated
Browse files Browse the repository at this point in the history
  • Loading branch information
fhemberger committed Mar 1, 2022
1 parent c07af11 commit 821bab7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
tags:
- '*'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
schedule:
- cron: '30 14 * * 3'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
# This is a basic workflow to help you get started with Actions

name: Test with pytest

# Controls when the workflow will run
on:
push:
branches:
branches:
- '*'
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2.4.0
- name: Check out repo
uses: actions/checkout@v2.4.0

- name: GitHub Action for pytest
uses: cclauss/GitHub-Action-for-pytest@0.5.0
Expand Down

0 comments on commit 821bab7

Please sign in to comment.