From 8bc5c47b314cb73d7ca0a172d5c0b384f2cca54a Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:32:11 +0200 Subject: [PATCH 1/3] Combine CI workflows into one file --- .github/workflows/{unit-tests.yml => ci.yml} | 32 +++++++++++++- .github/workflows/integration-tests.yml | 45 -------------------- 2 files changed, 30 insertions(+), 47 deletions(-) rename .github/workflows/{unit-tests.yml => ci.yml} (55%) delete mode 100644 .github/workflows/integration-tests.yml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/ci.yml similarity index 55% rename from .github/workflows/unit-tests.yml rename to .github/workflows/ci.yml index 530bf1030..53b63a2f6 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: unit-tests +name: ci on: push: branches: @@ -16,7 +16,7 @@ defaults: jobs: unit-test: - name: Unittesting on ${{ matrix.os }} with python ${{ matrix.python-version }} + name: unit tests | ${{ matrix.os }} | py${{ matrix.python-version }} runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false @@ -50,3 +50,31 @@ jobs: with: name: Unittest report path: ${{ matrix.os }}_${{ matrix.python-version }}_unit_test_report.html + integration-test: + name: integration tests | ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [macos, ubuntu, windows] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Conda and parcels + uses: ./.github/actions/install-parcels + with: + environment-file: environment.yml + - name: Integration test + run: | + coverage run -m pytest -v -s --nbval-lax -k "not documentation" --html="${{ matrix.os }}_integration_test_report.html" --self-contained-html docs/examples + coverage xml + - name: Codecov + uses: codecov/codecov-action@v3.1.1 + with: + flags: integration-tests + - name: Upload test results + if: ${{ always() }} # Always run this step, even if tests fail + uses: actions/upload-artifact@v3.1.2 + with: + name: Integration test report + path: ${{ matrix.os }}_integration_test_report.html diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml deleted file mode 100644 index 8aeee419c..000000000 --- a/.github/workflows/integration-tests.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: integration-tests -on: - push: - branches: - - "master" - - "test-me/*" - pull_request: - branches: - - "*" - schedule: - - cron: "0 7 * * 1" # Run every Monday at 7:00 UTC - -defaults: - run: - shell: bash -el {0} - -jobs: - integration-test: - name: ${{ matrix.os }} integration tests - runs-on: ${{ matrix.os }}-latest - strategy: - fail-fast: false - matrix: - os: [macos, ubuntu, windows] - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Conda and parcels - uses: ./.github/actions/install-parcels - with: - environment-file: environment.yml - - name: Integration test - run: | - coverage run -m pytest -v -s --nbval-lax -k "not documentation" --html="${{ matrix.os }}_integration_test_report.html" --self-contained-html docs/examples - coverage xml - - name: Codecov - uses: codecov/codecov-action@v3.1.1 - with: - flags: integration-tests - - name: Upload test results - if: ${{ always() }} # Always run this step, even if tests fail - uses: actions/upload-artifact@v3.1.2 - with: - name: Integration test report - path: ${{ matrix.os }}_integration_test_report.html From 16594caa181b72c9778ed09b894f9b9897e5a8ce Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:42:53 +0200 Subject: [PATCH 2/3] Add codecov token We were getting rate limited, so unit testing results weren't being uploaded --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53b63a2f6..f312879a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,7 @@ jobs: - name: Codecov uses: codecov/codecov-action@v3.1.1 with: + token: ${{ secrets.CODECOV_TOKEN }} flags: unit-tests - name: Upload test results if: ${{ always() }} # Always run this step, even if tests fail @@ -71,6 +72,7 @@ jobs: - name: Codecov uses: codecov/codecov-action@v3.1.1 with: + token: ${{ secrets.CODECOV_TOKEN }} flags: integration-tests - name: Upload test results if: ${{ always() }} # Always run this step, even if tests fail From 593cbdcfe00342bf98eb5c3064f0380b27702348 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:10:19 +0200 Subject: [PATCH 3/3] Update workflow display names --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f312879a1..6c0a62e3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ defaults: jobs: unit-test: - name: unit tests | ${{ matrix.os }} | py${{ matrix.python-version }} + name: "py${{ matrix.python-version }} | ${{ matrix.os }} | unit tests" runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false @@ -52,12 +52,13 @@ jobs: name: Unittest report path: ${{ matrix.os }}_${{ matrix.python-version }}_unit_test_report.html integration-test: - name: integration tests | ${{ matrix.os }} + name: "py${{ matrix.python-version }} | ${{ matrix.os }} | integration tests" runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false matrix: os: [macos, ubuntu, windows] + python-version: ["3.12"] steps: - name: Checkout uses: actions/checkout@v3