Skip to content

Commit

Permalink
autocancel CI when new commit is made on a pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
Krastanov committed Nov 21, 2024
1 parent 3ccd676 commit aa10cbe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci-julia-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ on:
branches: [master, main]
tags: ["*"]
pull_request:

concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the master branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main') || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

env:
PYTHON: ~
jobs:
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ on:
branches: [master, main]
tags: ["*"]
pull_request:

concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the master branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main') || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

env:
PYTHON: ~
jobs:
Expand All @@ -19,7 +27,8 @@ jobs:
os:
- ubuntu-latest
threads:
- '2'
- '1'
- '5'
arch:
- x64
include:
Expand All @@ -34,7 +43,7 @@ jobs:
- arch: x64
os: windows-latest
version: '1'
threads: '1'
threads: '1'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
Expand All @@ -56,16 +65,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install binary dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
with:
prefix: xvfb-run
env:
GKSwstype: nul # Fix for Plots with GR backend.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit aa10cbe

Please sign in to comment.