-
Notifications
You must be signed in to change notification settings - Fork 5
127 lines (120 loc) · 4.38 KB
/
ci.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI
on:
push:
branches:
- master
- 'v[0-9]*'
tags:
- 'v[0-9]*'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
tests:
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest, macos-14]
exclude:
- os: macos-14
python_version: "3.9"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Choose Python version ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python_version }}'
cache: 'pip'
- run: |
[[ "${{ matrix.os }}" = "ubuntu-latest" ]] && sudo apt-get install -y libcap-dev || true
shell: bash
- name: install tox
run: python3 -m pip install tox tox-uv
- name: run tox
run: tox -e 'py${{ matrix.python_version }}'
- name: submit code coverage
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
additional:
strategy:
matrix:
envs: ["numba_coverage", "docs-check"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Choose Python version 3.11'
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- run: sudo apt-get install -y pandoc libcap-dev
- name: install tox
run: python3 -m pip install tox tox-uv
- name: 'run tox for environment ${{ matrix.envs }}'
run: tox -e '${{ matrix.envs }}'
- name: submit code coverage
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Choose Python version 3.11'
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- run: sudo apt-get install -y pandoc
- name: install tox
run: python3 -m pip install tox tox-uv
- name: 'run tox for docs-build-ci'
run: tox -e 'docs-build-ci'
- uses: actions/upload-pages-artifact@v3.0.1
with:
path: 'docs/build/html/'
deploy-docs:
runs-on: ubuntu-latest
needs: [build-docs, additional, tests]
if: github.ref == 'refs/heads/master'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- run: |
curl -XPOST -u "sk1p:${{secrets.PAGES_TRIGGER_GH_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H 'Content-Type: application/json' https://api.github.com/repos/LiberTEM/libertem.github.io/dispatches --data '{"event_type":"build_pages","client_payload":{"from":"LiberTEM-live"}}'
release:
runs-on: ubuntu-latest
needs: [tests, additional]
# master branch, stable branches or release tags:
if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/v') || github.ref == 'refs/heads/master'
env:
LT_RELEASE_UPLOAD_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LT_RELEASE_UPLOAD_PYPI_TEST_PASSWORD: ${{ secrets.LT_RELEASE_UPLOAD_PYPI_TEST_PASSWORD }}
LT_RELEASE_UPLOAD_PYPI_PASSWORD: ${{ secrets.LT_RELEASE_UPLOAD_PYPI_PASSWORD }}
LT_RELEASE_UPLOAD_ZENODO_SANDBOX_TOKEN: ${{ secrets.LT_RELEASE_UPLOAD_ZENODO_SANDBOX_TOKEN }}
LT_RELEASE_UPLOAD_ZENODO_TOKEN: ${{ secrets.LT_RELEASE_UPLOAD_ZENODO_TOKEN }}
LT_RELEASE_UPLOAD_ZENODO_SANDBOX_PARENT: ${{ secrets.LT_RELEASE_UPLOAD_ZENODO_SANDBOX_PARENT }}
LT_RELEASE_UPLOAD_ZENODO_PARENT: ${{ secrets.LT_RELEASE_UPLOAD_ZENODO_PARENT }}
steps:
- uses: actions/checkout@v4
- name: Choose Python version 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: 'pip'
- name: install release script deps
run: pip install -r scripts/requirements.txt
- name: release status
run: ./scripts/release status
- name: run release script
run: ./scripts/release --verbose upload --no-dry-run --pypi-user __token__ --pypi-test-user __token__