-
-
Notifications
You must be signed in to change notification settings - Fork 22
83 lines (70 loc) · 2.16 KB
/
main.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
name: main
on: [push, pull_request]
permissions:
contents: read
concurrency:
group: main-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.os }}
env:
DISPLAY: :99
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
pyodide-version: ['0.27.0a2']
test-config: [
# FIXME: recent version of chrome gets timeout
{runner: selenium, runtime: chrome, runtime-version: "125" },
]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.12
- uses: pyodide/pyodide-actions/download-pyodide@v1
with:
version: ${{ matrix.pyodide-version }}
to: dist
- uses: pyodide/pyodide-actions/install-browser@v2
with:
runner: ${{ matrix.test-config.runner }}
browser: ${{ matrix.test-config.runtime }}
browser-version: ${{ matrix.test-config.runtime-version }}
- name: Install requirements
shell: bash -l {0}
run: |
python3 -m pip install -e .[test]
- name: Run tests
shell: bash -l {0}
run: |
pytest -v \
--cov=micropip \
--dist-dir=./dist/ \
--runner=${{ matrix.test-config.runner }} \
--rt ${{ matrix.test-config.runtime }}
- uses: codecov/codecov-action@v3
if: ${{ github.event.repo.name == 'pyodide/micropip' || github.event_name == 'pull_request' }}
with:
fail_ci_if_error: false
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
environment: PyPi-deploy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install requirements and build wheel
shell: bash -l {0}
run: |
python -m pip install build twine
python -m build .
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}