From 00d8e9e75b4653c97db5b079ddf44bdca1ba9fbc Mon Sep 17 00:00:00 2001 From: ddundo Date: Sun, 15 Sep 2024 16:33:11 +0000 Subject: [PATCH 1/5] Reusing workflows --- .github/workflows/citation_check.yml | 20 +------ .github/workflows/test_suite.yml | 82 +++++----------------------- 2 files changed, 15 insertions(+), 87 deletions(-) diff --git a/.github/workflows/citation_check.yml b/.github/workflows/citation_check.yml index 0eab5f4..94f5983 100644 --- a/.github/workflows/citation_check.yml +++ b/.github/workflows/citation_check.yml @@ -1,36 +1,18 @@ name: 'Citation Check' on: - # 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' - # Allow manual triggerings workflow_dispatch: jobs: citation_check: - name: 'Check Citation' - runs-on: ubuntu-latest - - steps: - - name: 'Check out the repo' - uses: actions/checkout@v4 - - - name: 'Setup Python' - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: 'Check citation' - run: | - pip install cffconvert - make check_citation \ No newline at end of file + uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/citation_check.yml@45_reusing_workflows \ No newline at end of file diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index 5a3e636..77971b8 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -1,79 +1,25 @@ -name: 'Run Animate test suite' +name: 'Run Animate Test Suite' on: - # Run test suite whenever main is updated push: branches: - main - - # Run test suite whenever commits are pushed to an open PR pull_request: - - # Run test suite every Sunday at 1AM schedule: - cron: '0 1 * * 0' -concurrency: - # Cancel jobs running if new commits are pushed - group: > - ${{ github.workflow }}- - ${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - jobs: test_suite: - name: 'Test suite' - runs-on: ubuntu-latest - container: - image: ghcr.io/mesh-adaptation/firedrake-parmmg:latest - options: --user root - steps: - - name: 'Check out the repo' - id: checkout - uses: actions/checkout@v4 - - - 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: | - .github/workflows/test_suite.yml - *.py - *.cxx - - - name: 'Cleanup' - if: ${{ always() }} - run: | - cd .. - rm -rf build - - - name: 'Setup Python' - 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 Animate' - 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: ${{ (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 Animate' - 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 - export GITHUB_ACTIONS_TEST_RUN=1 - python $(which firedrake-clean) - export ANIMATE_CHECKPOINT_DIR=$(pwd)/.checkpoints - python -m coverage erase - python -m coverage run --source=animate -m pytest -v --durations=20 test - python -m coverage report \ No newline at end of file + uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/test_suite.yml@45_reusing_workflows + with: + install-command: 'python -m pip uninstall -y animate && python -m pip install -e .' + test-command: | + export GITHUB_ACTIONS_TEST_RUN=1 + python $(which firedrake-clean) + export ANIMATE_CHECKPOINT_DIR=$(pwd)/.checkpoints + python -m coverage erase + python -m coverage run --source=animate -m pytest -v --durations=20 test + python -m coverage report + changed-files-patterns: | + **/*.py + **/*.cxx From ae2da7fe6647cb72622cfb19966ce659f94901b1 Mon Sep 17 00:00:00 2001 From: ddundo Date: Sun, 15 Sep 2024 16:33:54 +0000 Subject: [PATCH 2/5] Remove citation check from Makefile --- Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index 2dc6873..9c1c9e6 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,5 @@ coverage: @python3 -m coverage html @echo "Done." -check_citation: - @echo "Checking CITATION.cff formatting..." - @cffconvert --validate - @echo "PASS" - tree: @tree -d . From 0d27513de5df2c9f1af38db474dfde0360a0f9b3 Mon Sep 17 00:00:00 2001 From: ddundo Date: Sun, 15 Sep 2024 16:42:03 +0000 Subject: [PATCH 3/5] Fix reusable workflow path --- .github/workflows/citation_check.yml | 5 ++++- .github/workflows/test_suite.yml | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/citation_check.yml b/.github/workflows/citation_check.yml index 94f5983..2e717f6 100644 --- a/.github/workflows/citation_check.yml +++ b/.github/workflows/citation_check.yml @@ -1,18 +1,21 @@ name: 'Citation Check' on: + # 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' + # Allow manual triggering workflow_dispatch: jobs: citation_check: - uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/citation_check.yml@45_reusing_workflows \ No newline at end of file + uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/reusable_citation_check.yml@45_reusing_workflows \ No newline at end of file diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index 77971b8..b625efe 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -1,16 +1,28 @@ name: 'Run Animate Test Suite' on: + # Run test suite whenever main is updated push: branches: - main + + # Run test suite whenever commits are pushed to an open PR pull_request: + + # Run test suite every Sunday at 1AM schedule: - cron: '0 1 * * 0' + concurrency: + # Cancel jobs running if new commits are pushed + group: > + ${{ github.workflow }}- + ${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: test_suite: - uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/test_suite.yml@45_reusing_workflows + uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/reusable_test_suite.yml@45_reusing_workflows with: install-command: 'python -m pip uninstall -y animate && python -m pip install -e .' test-command: | From 72d4179b270bb98cd75111bd5bb32deff4fe59ab Mon Sep 17 00:00:00 2001 From: ddundo Date: Sun, 15 Sep 2024 16:44:44 +0000 Subject: [PATCH 4/5] Remove concurrency --- .github/workflows/test_suite.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index b625efe..96c9d4f 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -13,13 +13,6 @@ on: schedule: - cron: '0 1 * * 0' - concurrency: - # Cancel jobs running if new commits are pushed - group: > - ${{ github.workflow }}- - ${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - jobs: test_suite: uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/reusable_test_suite.yml@45_reusing_workflows From 7b1737202700e3b39f758acb32fce7afbcbefee7 Mon Sep 17 00:00:00 2001 From: ddundo Date: Sun, 15 Sep 2024 16:58:33 +0000 Subject: [PATCH 5/5] Switch to main branch in docs --- .github/workflows/citation_check.yml | 2 +- .github/workflows/test_suite.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/citation_check.yml b/.github/workflows/citation_check.yml index 2e717f6..1f304b9 100644 --- a/.github/workflows/citation_check.yml +++ b/.github/workflows/citation_check.yml @@ -18,4 +18,4 @@ on: jobs: citation_check: - uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/reusable_citation_check.yml@45_reusing_workflows \ No newline at end of file + uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/reusable_citation_check.yml@main \ No newline at end of file diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml index 96c9d4f..75c4704 100644 --- a/.github/workflows/test_suite.yml +++ b/.github/workflows/test_suite.yml @@ -15,7 +15,7 @@ on: jobs: test_suite: - uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/reusable_test_suite.yml@45_reusing_workflows + uses: mesh-adaptation/mesh-adaptation-docs/.github/workflows/reusable_test_suite.yml@main with: install-command: 'python -m pip uninstall -y animate && python -m pip install -e .' test-command: |