Skip to content

Commit ac47550

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 8c96481 commit ac47550

File tree

4 files changed

+32
-21
lines changed

4 files changed

+32
-21
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: 16 additions & 5 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
@@ -19,11 +24,17 @@ jobs:
1924

2025
steps:
2126
- uses: actions/checkout@v4
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v3
2229
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v5
30+
run: |
31+
uv python install ${{ matrix.python-version }}
32+
- uses: actions/download-artifact@v4
2433
with:
25-
python-version: ${{ matrix.python-version }}
34+
name: reacton-build-${{ github.run_number }}
35+
path: ./dist
2636
- name: Install
27-
run: pip install ".[dev]" "black<23"
37+
run: |
38+
uv pip install `echo dist/*.whl`[dev] "black<23" --system
2839
- name: test
2940
run: pytest --cov=reacton reacton

0 commit comments

Comments
 (0)