Skip to content

Commit

Permalink
split workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnighter committed Aug 3, 2024
1 parent 3faf3ea commit b15962a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 37 deletions.
33 changes: 2 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 10 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit b15962a

Please sign in to comment.