Skip to content

Commit b8132c5

Browse files
committed
ci: streamline action flow
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
1 parent 65f0b2f commit b8132c5

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

.github/workflows/codequality.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
name: Code quality
2-
32
on:
4-
push:
5-
branches:
6-
- master
7-
tags:
8-
- v*
9-
pull_request:
3+
workflow_call:
104
workflow_dispatch:
115

126
jobs:
13-
build:
7+
code-quality:
148
runs-on: ubuntu-20.04
159
strategy:
1610
fail-fast: false

.github/workflows/installation.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
name: Test installation
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
tags:
8-
- v*
9-
pull_request:
4+
workflow_call:
105
workflow_dispatch:
116

127
jobs:
13-
build:
8+
test-installation:
149
runs-on: ubuntu-latest
1510

1611
steps:
@@ -27,3 +22,7 @@ jobs:
2722
run: pip install dist/*.whl
2823
- name: Test import
2924
run: python -c "import react_ipywidgets; import reacton"
25+
- uses: actions/upload-artifact@v4
26+
with:
27+
name: reacton-build-${{ github.run_number }}
28+
path: ./dist

.github/workflows/release.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ on:
66
- "*"
77

88
jobs:
9-
build:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: ./.github/workflows/unittest.yml
14+
15+
release:
16+
needs: test
1017
runs-on: ubuntu-latest
1118
steps:
1219
- uses: actions/checkout@v4

.github/workflows/unittest.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ on:
44
push:
55
branches:
66
- master
7-
tags:
8-
- v*
97
pull_request:
108
workflow_dispatch:
119

1210
jobs:
1311
build:
12+
uses: ./.github/workflows/installation.yml
13+
14+
code-quality:
15+
uses: ./.github/workflows/codequality.yaml
16+
17+
unit-test:
18+
needs: [build, code-quality]
1419
runs-on: ubuntu-20.04
1520
strategy:
1621
fail-fast: false
@@ -23,7 +28,14 @@ jobs:
2328
uses: actions/setup-python@v5
2429
with:
2530
python-version: ${{ matrix.python-version }}
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v3
33+
- uses: actions/download-artifact@v4
34+
with:
35+
name: reacton-build-${{ github.run_number }}
36+
path: ./dist
2637
- name: Install
27-
run: pip install ".[dev]" "black<23"
38+
run: |
39+
uv pip install `echo dist/*.whl`[dev] "black<23" --system
2840
- name: test
2941
run: pytest --cov=reacton reacton

0 commit comments

Comments
 (0)