Skip to content

Commit e8317aa

Browse files
authored
Merge pull request #8 from opencollector/fix/run-tests-on-wheel-build
Run tests before the wheel build
2 parents 760d307 + ee05412 commit e8317aa

3 files changed

Lines changed: 37 additions & 15 deletions

File tree

.github/workflows/main.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
on:
2+
pull_request:
3+
types:
4+
- opened
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- "v*"
10+
11+
jobs:
12+
lint_and_test:
13+
uses: ./.github/workflows/tests.yml
14+
15+
build_wheels:
16+
needs:
17+
- lint_and_test
18+
if: ${{ startsWith(github.ref, 'refs/tags/v.*') }}
19+
uses: ./.github/workflows/wheels.yml

.github/workflows/tests.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
name: Lint source and run tests
2+
13
on:
2-
push:
3-
branches:
4+
workflow_call:
45

56
jobs:
6-
test:
7-
name: Test and lint sources
7+
lint_and_test:
8+
name: Lint source and run tests
89
runs-on: ubuntu-latest
9-
container:
10-
image: python:3.11
1110
steps:
12-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
12+
13+
- uses: actions/setup-python@v3
14+
with:
15+
python-version: "3.11"
1316

1417
- name: Set up environment
1518
run: |

.github/workflows/wheels.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
name: Build
1+
name: Build wheels
22

33
on:
4-
push:
5-
tags:
6-
- v*
4+
workflow_call:
75

86
jobs:
97
build_wheels:
@@ -16,20 +14,22 @@ jobs:
1614
os:
1715
- ubuntu-20.04
1816
- windows-2019
19-
- macOS-10.15
17+
- macOS-11
18+
- macOS-12
19+
- macOS-13
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
2323

2424
# Used to host cibuildwheel
25-
- uses: actions/setup-python@v2
25+
- uses: actions/setup-python@v3
2626

2727
- name: Install cibuildwheel
2828
run: python -m pip install cibuildwheel>=2.*.*
2929

3030
- name: Build wheels
3131
run: python -m cibuildwheel --output-dir wheelhouse
3232

33-
- uses: actions/upload-artifact@v2
33+
- uses: actions/upload-artifact@v3
3434
with:
3535
path: ./wheelhouse/*.whl

0 commit comments

Comments
 (0)