From 6827403b3b61e1fc95c045fc34af43d9a2a40668 Mon Sep 17 00:00:00 2001 From: Joe Wallwork <22053413+jwallwork23@users.noreply.github.com> Date: Sun, 15 Sep 2024 10:12:11 +0100 Subject: [PATCH] Separate out test workflows for changed files check vs. full test suite (#216) --- .github/workflows/citation_check.yml | 11 ++++++----- .github/workflows/test_suite.yml | 9 +++++---- CITATION.cff | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/citation_check.yml b/.github/workflows/citation_check.yml index f49e374a..4b70249e 100644 --- a/.github/workflows/citation_check.yml +++ b/.github/workflows/citation_check.yml @@ -1,10 +1,14 @@ name: 'Citation Check' on: - # Run only when commits are pushed to a branch or a PR that modifies a .cff file + # Run when a branch that modifies a .cff file is merged into main push: + branches: + - main paths: - '**/*.cff' + + # Run when commits are pushed to a branch or a PR that modifies a .cff file pull_request: paths: - '**/*.cff' @@ -16,9 +20,6 @@ jobs: citation_check: name: 'Check Citation' runs-on: ubuntu-latest - container: - image: ghcr.io/mesh-adaptation/firedrake-parmmg:latest - options: --user root steps: - name: 'Check out the repo' @@ -31,5 +32,5 @@ jobs: - name: 'Check citation' run: | - . /home/firedrake/firedrake/bin/activate + pip install cffconvert make check_citation diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index 6deb34a0..93cfe880 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -34,6 +34,7 @@ jobs: - name: 'Determine files differing from target branch' id: changed-files + if: ${{ github.event_name != 'push' && github.ref != 'refs/heads/main' }} uses: tj-actions/changed-files@v44 with: files: | @@ -49,26 +50,26 @@ jobs: rm -rf build - name: 'Setup Python' - if: ${{ (steps.changed-files.outputs.any_changed == 'true') || ( github.event_name == 'schedule') }} + if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (steps.changed-files.outcome == 'success' && steps.changed-files.outputs.any_changed == 'true') || github.event_name == 'schedule' }} uses: actions/setup-python@v2 with: python-version: 3.8 - name: 'Install Goalie' - if: ${{ (steps.changed-files.outputs.any_changed == 'true') || ( github.event_name == 'schedule') }} + if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (steps.changed-files.outcome == 'success' && steps.changed-files.outputs.any_changed == 'true') || github.event_name == 'schedule' }} run: | . /home/firedrake/firedrake/bin/activate python -m pip uninstall -y goalie python -m pip install -e . - name: 'Lint' - if: ${{ (steps.changed-files.outputs.any_changed == 'true') || ( github.event_name == 'schedule') }} + if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (steps.changed-files.outcome == 'success' && steps.changed-files.outputs.any_changed == 'true') || github.event_name == 'schedule' }} run: | . /home/firedrake/firedrake/bin/activate make lint - name: 'Test Goalie' - if: ${{ (steps.changed-files.outputs.any_changed == 'true') || ( github.event_name == 'schedule') }} + if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (steps.changed-files.outcome == 'success' && steps.changed-files.outputs.any_changed == 'true') || github.event_name == 'schedule' }} run: | . /home/firedrake/firedrake/bin/activate python $(which firedrake-clean) diff --git a/CITATION.cff b/CITATION.cff index 5eaae585..7510cf43 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,5 +1,5 @@ cff-version: 1.2.0 -message: If you use this software in a publication, please cite it using these metadata. +message: If you use this software in a publication then please cite it using these metadata. title: Goalie abstract: Goal-oriented error estimation and mesh adaptation for finite element problems solved using Firedrake. authors: