Skip to content

Commit

Permalink
ci: streamline action flow
Browse files Browse the repository at this point in the history
This way all the actions run under unit-tests, so they can be viewed in one action run. We also only build the package once

For release, we require tests to pass, but still build the wheel again to upload
  • Loading branch information
iisakkirotko committed Dec 13, 2024
1 parent 8c96481 commit 5a8859f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/codequality.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
name: Code quality

on:
push:
branches:
- master
tags:
- v*
pull_request:
workflow_call:
workflow_dispatch:

jobs:
build:
code-quality:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/installation.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
name: Test installation

on:
push:
branches:
- master
tags:
- v*
pull_request:
workflow_call:
workflow_dispatch:

jobs:
build:
test-installation:
runs-on: ubuntu-latest

steps:
Expand All @@ -27,3 +22,7 @@ jobs:
run: pip install dist/*.whl
- name: Test import
run: python -c "import react_ipywidgets; import reacton"
- uses: actions/upload-artifact@v4
with:
name: reacton-build-${{ github.run_number }}
path: ./dist
9 changes: 8 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ on:
- "*"

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/unittest.yml

release:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ on:
push:
branches:
- master
tags:
- v*
pull_request:
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/installation.yml

code-quality:
uses: ./.github/workflows/codequality.yaml

unit-test:
needs: [build, code-quality]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand All @@ -23,7 +28,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
name: reacton-build-${{ github.run_number }}
path: ./dist
- name: Install
run: pip install ".[dev]" "black<23"
run: |
pip install `echo dist/*.whl`[dev] "black<23"
- name: test
run: pytest --cov=reacton reacton

0 comments on commit 5a8859f

Please sign in to comment.