-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (89 loc) · 2.56 KB
/
test_package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Package Installation Tests
on:
push: {}
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ vars.CI_PYTHON_VERSION }}
- name: Install Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ vars.CI_POETRY_VERSION }}
- name: Install Poetry plugins
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Build package
run: |
poetry build
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 1
test-package:
needs: build
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download package
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Test wheel installation (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$wheel = Get-ChildItem dist/*.whl | Select-Object -First 1
pip install $wheel
python -c "import ipybox"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
pip uninstall -y ipybox
- name: Test wheel installation (Unix)
if: runner.os != 'Windows'
run: |
pip install dist/*.whl
python -c "import ipybox"
pip uninstall -y ipybox
- name: Test tarball installation (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$tarball = Get-ChildItem dist/*.tar.gz | Select-Object -First 1
pip install $tarball
python -c "import ipybox"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
pip uninstall -y ipybox
- name: Test tarball installation (Unix)
if: runner.os != 'Windows'
run: |
pip install dist/*.tar.gz
python -c "import ipybox"
pip uninstall -y ipybox
- name: Run smoke test (Linux)
if: runner.os == 'Linux'
run: |
pip install dist/*.whl
pip install pytest pytest-asyncio
pytest tests/test_basic.py
pip uninstall -y ipybox