Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test pull request

on:
pull_request:
branches:
- main
- future

jobs:
test_main:
if: github.base_ref == 'main'
uses: ./.github/workflows/test.yml
with:
source_ref: ${{ github.ref }}
firedrake_docker_version: dev-release
secrets: inherit

test_future:
if: github.base_ref == 'future'
uses: ./.github/workflows/test.yml
with:
source_ref: ${{ github.ref }}
firedrake_docker_version: dev-main
secrets: inherit
24 changes: 24 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test push

on:
push:
branches:
- main
- future

jobs:
test_main:
if: github.ref_name == 'main'
uses: ./.github/workflows/test.yml
with:
source_ref: main
firedrake_docker_version: dev-release
secrets: inherit

test_future:
if: github.ref_name == 'future'
uses: ./.github/workflows/test.yml
with:
source_ref: future
firedrake_docker_version: dev-main
secrets: inherit
21 changes: 21 additions & 0 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Weekly tests

on:
schedule:
# Scheduled for 0330 UTC on Monday mornings to detect bitrot
- cron: '30 3 * * 1'

jobs:
test_main:
uses: ./.github/workflows/test.yml
with:
source_ref: main
firedrake_docker_version: dev-release
secrets: inherit

test_future:
uses: ./.github/workflows/test.yml
with:
source_ref: future
firedrake_docker_version: dev-main
secrets: inherit
36 changes: 17 additions & 19 deletions .github/workflows/build.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
name: Build Gusto

on:
# Push to main or PR
push:
branches:
- main
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
# Scheduled build at 0330 UTC on Monday mornings to detect bitrot.
- cron: '30 3 * * 1'

workflow_call:
inputs:
source_ref:
description: The Git ref to checkout
type: string
required: true
firedrake_docker_version:
description: The Firedrake Docker version to use ('dev-main' or 'dev-release')
type: string
required: true

# Cancel jobs running if new commits are pushed
concurrency:
# Cancels jobs running if new commits are pushed
group: >
${{ github.workflow }}-
${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: "Build Gusto"
# The type of runner that the job will run on
test:
name: Test Gusto
runs-on: [self-hosted, Linux]
# The docker container to use.
container:
image: firedrakeproject/firedrake-vanilla-default:latest
image: firedrakeproject/firedrake-vanilla-default:${{ inputs.firedrake_docker_version }}
env:
# Make Gusto output logging information, this will *not* be printed to
# the terminal because pytest will capture it. Instead it is written to
Expand All @@ -48,11 +45,12 @@ jobs:
find . -delete
firedrake-clean
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Download Gusto into a subdirectory not called 'gusto' to make sure
# that the package installs correctly. Otherwise 'import gusto' may
# work even if the installation failed because it is a subdirectory.
ref: ${{ inputs.source_ref }}
path: gusto-repo

- name: Create virtual environment
Expand Down