From b15962aaa1c45f5726552ce13260f444267a41fb Mon Sep 17 00:00:00 2001 From: "Moritz E. Beber" Date: Sat, 3 Aug 2024 17:08:37 +0200 Subject: [PATCH] split workflows --- .github/workflows/main.yml | 33 ++------------------------------ .github/workflows/release.yaml | 16 ++++++++++------ .github/workflows/tests.yaml | 35 ++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f9868e3..488f2fc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,40 +5,11 @@ on: branches: - stable - devel - tags: - - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' pull_request: branches: - stable - devel jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: -# os: [ubuntu-latest, macos-latest, windows-latest] - os: [ubuntu-latest] - python-version: ["3.8"] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install tox tox-gh-actions - - - name: Test with tox - run: tox -- --cov-report=xml - - - name: Report coverage - shell: bash - run: bash <(curl -s https://codecov.io/bash) + tests: + uses: ./.github/workflows/tests.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 43d7edb..cdf7bd5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,13 +1,17 @@ +name: CD + on: - workflow_run: - workflows: [ CI ] - types: - - completed + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' jobs: + tests: + uses: ./.github/workflows/tests.yml + release: - needs: test - if: github.ref_type == 'tag' && github.event.workflow_run.conclusion == 'success' + needs: tests runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..11e9792 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,35 @@ +name: Test Suite + +on: + workflow_dispatch: {} + workflow_call: {} + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + # os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest] + python-version: ["3.8"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install tox tox-gh-actions + + - name: Test with tox + run: tox -- --cov-report=xml + + - name: Report coverage + shell: bash + run: bash <(curl -s https://codecov.io/bash)