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
26 changes: 13 additions & 13 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
description: The input Git ref to checkout
type: string
required: true
target_branch:
description: The target branch (usually 'main' or 'release')
base_ref:
description: The base branch ('main' or 'release')
type: string
required: true
build_docs:
Expand All @@ -34,8 +34,8 @@ on:
description: The input Git ref to checkout
type: string
required: true
target_branch:
description: The target branch (usually 'main' or 'release')
base_ref:
description: The base branch ('main' or 'release')
type: string
required: true
build_docs:
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
with:
os: linux
source_ref: ${{ inputs.source_ref }}
base_ref: ${{ inputs.target_branch }}
base_ref: ${{ inputs.base_ref }}
scalar_type: ${{ matrix.arch }}
deps: ci

Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
matrix.arch == 'default'
run: |
. venv/bin/activate
if [ ${{ inputs.target_branch }} = 'release' ]; then
if [ ${{ inputs.base_ref }} = 'release' ]; then
GUSTO_BRANCH='main'
else
GUSTO_BRANCH='future'
Expand All @@ -219,7 +219,7 @@ jobs:
matrix.arch == 'default'
run: |
. venv/bin/activate
git clone --depth 1 https://github.com/thetisproject/thetis.git thetis-repo --branch ${{ inputs.target_branch }}
git clone --depth 1 https://github.com/thetisproject/thetis.git thetis-repo --branch ${{ inputs.base_ref }}
pip install --verbose ./thetis-repo
python -m pytest -n 8 --verbose thetis-repo/test_adjoint/test_swe_adjoint.py
timeout-minutes: 10
Expand All @@ -241,7 +241,7 @@ jobs:
matrix.arch == 'default'
run: |
. venv/bin/activate
git clone --depth 1 https://github.com/g-adopt/g-adopt.git g-adopt-repo --branch ${{ inputs.target_branch }}
git clone --depth 1 https://github.com/g-adopt/g-adopt.git g-adopt-repo --branch ${{ inputs.base_ref }}
pip install --verbose ./g-adopt-repo
make -C g-adopt-repo/demos/mantle_convection/base_case check
timeout-minutes: 5
Expand Down Expand Up @@ -281,7 +281,7 @@ jobs:
with:
os: macos
source_ref: ${{ inputs.source_ref }}
base_ref: ${{ inputs.target_branch }}
base_ref: ${{ inputs.base_ref }}
deps: check

- name: Post-run cleanup
Expand Down Expand Up @@ -326,7 +326,7 @@ jobs:
with:
os: linux
source_ref: ${{ inputs.source_ref }}
base_ref: ${{ inputs.target_branch }}
base_ref: ${{ inputs.base_ref }}
gpu: cuda
deps: check

Expand Down Expand Up @@ -394,7 +394,7 @@ jobs:
name: Build documentation
runs-on: [self-hosted, Linux]
container:
image: firedrakeproject/firedrake-vanilla-default:dev-${{ inputs.target_branch }}
image: firedrakeproject/firedrake-vanilla-default:dev-${{ inputs.base_ref }}
outputs:
conclusion: ${{ steps.report_docs.outputs.conclusion }}
steps:
Expand All @@ -421,7 +421,7 @@ jobs:
id: build_docs
working-directory: firedrake-repo/docs
run: |
make SPHINXOPTS="-t ${{ inputs.target_branch }}" html
make SPHINXOPTS="-t ${{ inputs.base_ref }}" html
make latex
make latexpdf
# : Copy manual to HTML tree
Expand Down Expand Up @@ -476,7 +476,7 @@ jobs:
if: |
always() &&
inputs.deploy_website &&
inputs.target_branch == 'main' &&
inputs.base_ref == 'main' &&
needs.build_docs.outputs.conclusion == 'success'
permissions:
pages: write
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@ name: Test pull request

on:
pull_request:
types: [ opened, synchronize, reopened, labeled ]
types: [ opened, synchronize, reopened, labeled, unlabeled ]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this now but we didn't before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want the workflow to be triggered whenever the labels change, not just when a new label is added. I ran into this because I was switching out the labels to test this and found that it wasn't being rerun as expected.


jobs:
test:
uses: ./.github/workflows/core.yml
with:
source_ref: ${{ github.ref }}
target_branch: ${{ github.base_ref }}
# If not the actual target of the PR, the target branch ('main' or 'release')
# can be set with an appropriate label ('base:main' or 'base:release')
base_ref: |-
${{ case(
contains(github.event.pull_request.labels.*.name, 'base:main'), 'main',
contains(github.event.pull_request.labels.*.name, 'base:release'), 'release',
github.base_ref == 'main', 'main',
github.base_ref == 'release', 'release',
'INVALID_BASE_REF'
) }}
# Only run macOS tests if the PR is labelled 'macOS'
test_macos: ${{ contains(github.event.pull_request.labels.*.name, 'macOS') }}
# Only run GPU tests if the PR is labelled 'gpu'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: ./.github/workflows/core.yml
with:
source_ref: ${{ github.ref_name }}
target_branch: ${{ github.ref_name }}
base_ref: ${{ github.ref_name }}
test_macos: true
test_gpu: true
deploy_website: true
Expand Down
Loading