Skip to content

Commit 84e5896

Browse files
Improve CI
1 parent aab1096 commit 84e5896

File tree

1 file changed

+53
-17
lines changed

1 file changed

+53
-17
lines changed

.github/workflows/workflow.yml

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,39 @@ on:
1010
branches: [ "master", "dev" ]
1111

1212
jobs:
13-
build-test:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.10'
23+
24+
- name: Install pypa-build
25+
run: python -m pip install build
26+
27+
- name: Create wheel and sdist
28+
run: python -m build -s -w --outdir dist .
29+
30+
- name: Upload sdist
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: sdist
34+
path: dist/*.tar.gz
35+
36+
- name: Upload wheel
37+
uses: actions/upload-artifact@v3
38+
with:
39+
name: wheel
40+
path: dist/*.whl
41+
42+
test:
1443
runs-on: ${{ matrix.os }}
44+
needs: build
45+
1546
strategy:
1647
fail-fast: false
1748
matrix:
@@ -20,38 +51,42 @@ jobs:
2051

2152
steps:
2253
- uses: actions/checkout@v3
54+
2355
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v3
56+
uses: actions/setup-python@v4
2557
with:
2658
python-version: ${{ matrix.python-version }}
2759

2860
- name: Setup FFmpeg
2961
uses: FedericoCarboni/setup-ffmpeg@v1.1.0
3062

63+
- name: Download wheel
64+
uses: actions/download-artifact@v3
65+
with:
66+
name: wheel
67+
path: dist
68+
3169
- name: Run Unit Tests
70+
shell: bash
3271
run: |
72+
python -m pip install dist/*
3373
python -m unittest discover tests -v
3474
3575
latest-release:
36-
needs: build-test
76+
needs: test
3777
runs-on: ubuntu-latest
3878
steps:
39-
- uses: actions/checkout@v2
40-
41-
- name: Set up Python
42-
uses: actions/setup-python@v3
79+
- name: Download sdist
80+
uses: actions/download-artifact@v3
4381
with:
44-
python-version: "3.10"
45-
46-
- name: Create sdist
47-
run: |
48-
python setup.py sdist
82+
name: sdist
83+
path: dist
4984

50-
- name: Create Artifact sdist
51-
uses: actions/upload-artifact@v3
85+
- name: Download wheel
86+
uses: actions/download-artifact@v3
5287
with:
53-
name: sdist
54-
path: dist/*.tar.gz
88+
name: wheel
89+
path: dist
5590

5691
- uses: "marvinpinto/action-automatic-releases@latest"
5792
if: ${{ github.ref == 'refs/heads/master' }}
@@ -61,4 +96,5 @@ jobs:
6196
prerelease: true
6297
title: "Development Build"
6398
files: |
64-
dist/*.tar.gz
99+
dist/*.tar.gz
100+
dist/*.whl

0 commit comments

Comments
 (0)