Skip to content

Commit

Permalink
Refactor GitHub workflow files for improved concurrency handling
Browse files Browse the repository at this point in the history
This commit refactors the GitHub workflow files to improve concurrency handling. The changes include adding a new `concurrency` section to each file, which allows builds to complete even if merging happens faster. This makes it easier to discover at which point something broke. The `group` value in the `concurrency` section is set based on the branch being built, using a combination of the branch name and the commit SHA.

The affected files are:
- `.github/workflows/clang-format-check.yml`
- `.github/workflows/codecov-upload.yml`
- `.github/workflows/codeql-analysis.yml`
- `.github/workflows/linux-clang-pkgx.yml`
- `.github/workflows/linux-clang.yml`
- `.github/workflows/linux-gcc.yml`
- `.github/workflows/macos.yml`
- `.github/workflows/sonarcloud.yml`
- `.github/workflows/windows-msvc.yml`
- `.github/workflows/windows-pkgx.yml`

Additionally, the Travis CI configuration file (`.travis.yml`) has been updated to handle different versions of GCC and Clang compilers.

These changes aim to enhance build performance and reliability by ensuring that all builds complete successfully, regardless of merge speed.
  • Loading branch information
acgetchell committed Nov 7, 2023
1 parent c6098d0 commit ed905ab
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: clang-format Check
on: [push, pull_request]

concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}
jobs:
formatting-check:
name: Formatting Check
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/codecov-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: CodeCov

on: [push, pull_request, workflow_dispatch]

concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}

jobs:
codecov:
name: CodeCov
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ on:
- cron: '26 7 * * 0'
workflow_dispatch:

concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}

jobs:
analyze:
name: Analyze
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/linux-clang-pkgx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Linux Clang with pkgx

on: [push, pull_request, workflow_dispatch]

concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}

jobs:
build:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/linux-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Linux Clang

on: [push, pull_request, workflow_dispatch]

concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}

jobs:
build:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/linux-gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Linux GCC

on: [push, pull_request, workflow_dispatch]

concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}

jobs:
build:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: macOS

on: [push, pull_request, workflow_dispatch]

concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}

jobs:
build:
runs-on: macos-13
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: SonarCloud

on: [push, pull_request, workflow_dispatch]

concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}

jobs:
sonarcloud:
name: SonarCloud
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/windows-msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Windows

on: [workflow_dispatch]

concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}

jobs:
build:
runs-on: windows-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/windows-pkgx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Windows pkgx

on: [workflow_dispatch]

concurrency:
# Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}.
# On master, we want all builds to complete even if merging happens faster to make it easier to discover at which point something broke.
group: ${{ github.ref == 'refs/heads/master' && format('ci-master-{0}', github.sha) || format('ci-{0}', github.ref) }}

jobs:
build:
runs-on: windows-latest
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ before_install:
- sudo install -m 755 pkgx /usr/local/bin
- pkgx --help
- if [[ "$CXX" == "g++" ]]; then
|
env +gcc@13
export CXX="g++-13" CC="gcc-13"
fi
- if [[ "$CXX" == "clang++" ]]; then
|
env +clang@16
export CXX="clang++-16" CC="clang-16"
fi
Expand Down

0 comments on commit ed905ab

Please sign in to comment.