Skip to content

Commit cd22cf7

Browse files
authored
Refactor CI to work with Firedrake release and main (#665)
1 parent fcc68c5 commit cd22cf7

File tree

4 files changed

+86
-19
lines changed

4 files changed

+86
-19
lines changed

.github/workflows/pr.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test pull request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- future
8+
9+
jobs:
10+
test_main:
11+
if: github.base_ref == 'main'
12+
uses: ./.github/workflows/test.yml
13+
with:
14+
source_ref: ${{ github.ref }}
15+
firedrake_docker_version: dev-release
16+
secrets: inherit
17+
18+
test_future:
19+
if: github.base_ref == 'future'
20+
uses: ./.github/workflows/test.yml
21+
with:
22+
source_ref: ${{ github.ref }}
23+
firedrake_docker_version: dev-main
24+
secrets: inherit

.github/workflows/push.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- future
8+
9+
jobs:
10+
test_main:
11+
if: github.ref_name == 'main'
12+
uses: ./.github/workflows/test.yml
13+
with:
14+
source_ref: main
15+
firedrake_docker_version: dev-release
16+
secrets: inherit
17+
18+
test_future:
19+
if: github.ref_name == 'future'
20+
uses: ./.github/workflows/test.yml
21+
with:
22+
source_ref: future
23+
firedrake_docker_version: dev-main
24+
secrets: inherit

.github/workflows/schedule.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Weekly tests
2+
3+
on:
4+
schedule:
5+
# Scheduled for 0330 UTC on Monday mornings to detect bitrot
6+
- cron: '30 3 * * 1'
7+
8+
jobs:
9+
test_main:
10+
uses: ./.github/workflows/test.yml
11+
with:
12+
source_ref: main
13+
firedrake_docker_version: dev-release
14+
secrets: inherit
15+
16+
test_future:
17+
uses: ./.github/workflows/test.yml
18+
with:
19+
source_ref: future
20+
firedrake_docker_version: dev-main
21+
secrets: inherit

.github/workflows/build.yml renamed to .github/workflows/test.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1-
name: Build Gusto
2-
31
on:
4-
# Push to main or PR
5-
push:
6-
branches:
7-
- main
8-
pull_request:
9-
schedule:
10-
# * is a special character in YAML so you have to quote this string
11-
# Scheduled build at 0330 UTC on Monday mornings to detect bitrot.
12-
- cron: '30 3 * * 1'
13-
2+
workflow_call:
3+
inputs:
4+
source_ref:
5+
description: The Git ref to checkout
6+
type: string
7+
required: true
8+
firedrake_docker_version:
9+
description: The Firedrake Docker version to use ('dev-main' or 'dev-release')
10+
type: string
11+
required: true
12+
13+
# Cancel jobs running if new commits are pushed
1414
concurrency:
15-
# Cancels jobs running if new commits are pushed
1615
group: >
1716
${{ github.workflow }}-
1817
${{ github.event.pull_request.number || github.ref }}
1918
cancel-in-progress: true
2019

2120
jobs:
22-
build:
23-
name: "Build Gusto"
24-
# The type of runner that the job will run on
21+
test:
22+
name: Test Gusto
2523
runs-on: [self-hosted, Linux]
26-
# The docker container to use.
2724
container:
28-
image: firedrakeproject/firedrake-vanilla-default:latest
25+
image: firedrakeproject/firedrake-vanilla-default:${{ inputs.firedrake_docker_version }}
2926
env:
3027
# Make Gusto output logging information, this will *not* be printed to
3128
# the terminal because pytest will capture it. Instead it is written to
@@ -48,11 +45,12 @@ jobs:
4845
find . -delete
4946
firedrake-clean
5047
51-
- uses: actions/checkout@v4
48+
- uses: actions/checkout@v5
5249
with:
5350
# Download Gusto into a subdirectory not called 'gusto' to make sure
5451
# that the package installs correctly. Otherwise 'import gusto' may
5552
# work even if the installation failed because it is a subdirectory.
53+
ref: ${{ inputs.source_ref }}
5654
path: gusto-repo
5755

5856
- name: Create virtual environment

0 commit comments

Comments
 (0)