Skip to content

Commit c27af33

Browse files
authored
Merge pull request #37 from eisenhauer/modernize-ci
Modernize CI configuration
2 parents e83910d + c25027f commit c27af33

2 files changed

Lines changed: 33 additions & 17 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
name: Build and Test
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
pull_request:
8-
branches:
9-
- master
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
schedule:
11+
- cron: '0 6 * * 1' # Monday 6am UTC - weekly build to catch dependency issues
1012

1113
concurrency:
12-
group: ${{ github.head_ref || github.run_id }}
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1315
cancel-in-progress: true
1416

1517
jobs:
@@ -30,8 +32,6 @@ jobs:
3032
buildtype: [ release, debug ]
3133
os: [ alma9, ubuntu2204, ubuntu2404 ]
3234
compiler: [ clang, gcc ]
33-
exclude:
34-
- { os: alma9, compiler: nvhpc }
3535
include:
3636
- os: alma9
3737
container: almalinux:9
@@ -41,12 +41,19 @@ jobs:
4141
container: ubuntu:22.04
4242

4343
steps:
44-
- uses: actions/checkout@v2
44+
- uses: actions/checkout@v4
4545
with:
4646
ref: ${{ github.event.pull_request.head.sha }}
4747
path: source
4848
- name: Setup
4949
run: source/scripts/ci/setup/linux.sh
50+
- name: Cache CMake build
51+
uses: actions/cache@v4
52+
with:
53+
path: build
54+
key: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.buildtype }}-${{ hashFiles('source/CMakeLists.txt', 'source/**/*.cmake') }}
55+
restore-keys: |
56+
${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.buildtype }}-
5057
- name: Update
5158
run: source/scripts/ci/gh-actions/run.sh update
5259
- name: Configure
@@ -90,16 +97,23 @@ jobs:
9097
shell: bash
9198

9299
steps:
93-
- uses: actions/checkout@v2
100+
- uses: actions/checkout@v4
94101
with:
95102
ref: ${{ github.event.pull_request.head.sha }}
96103
path: source
97-
- name: Setup
104+
- name: Setup Windows
98105
if: ${{ runner.os == 'Windows' }}
99106
run: source/scripts/ci/setup/windows.sh
100-
- name: Setup
107+
- name: Setup macOS
101108
if: ${{ runner.os == 'macOS' }}
102109
run: source/scripts/ci/setup/macos.sh
110+
- name: Cache CMake build
111+
uses: actions/cache@v4
112+
with:
113+
path: build
114+
key: ${{ matrix.jobname }}-${{ matrix.buildtype }}-${{ hashFiles('source/CMakeLists.txt', 'source/**/*.cmake') }}
115+
restore-keys: |
116+
${{ matrix.jobname }}-${{ matrix.buildtype }}-
103117
- name: Update
104118
run: source/scripts/ci/gh-actions/run.sh update
105119
- name: Configure

.github/workflows/triggers.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ name: Triggers
33
on:
44
workflow_run:
55
workflows: ["Build and Test"]
6-
types: [requested]
6+
types: [requested, completed]
77

88
jobs:
9-
all_triggers:
9+
post_cdash_link:
1010
runs-on: ubuntu-latest
11+
# Only post CDash link when workflow completes (results are available)
12+
if: ${{ github.event.action == 'completed' }}
1113

1214
steps:
13-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1416
- name: Post CDash Status
1517
run: scripts/ci/scripts/post-cdash-status.sh ${{ github.event.repository.full_name }} ${{ github.event.workflow_run.head_sha }} ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)