-
Notifications
You must be signed in to change notification settings - Fork 5
120 lines (113 loc) · 4.14 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
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.7", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Choose Python version ${{ matrix.python_version }}
uses: actions/setup-python@v4
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
- name: run tox
run: tox -e 'py${{ matrix.python_version }}'
- name: submit code coverage
uses: codecov/codecov-action@v3
additional:
strategy:
matrix:
envs: ["numba_coverage", "docs-check"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Choose Python version 3.11'
uses: actions/setup-python@v4
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
- name: 'run tox for environment ${{ matrix.envs }}'
run: tox -e '${{ matrix.envs }}'
- name: submit code coverage
uses: codecov/codecov-action@v3
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Choose Python version 3.11'
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- run: sudo apt-get install -y pandoc
- name: install tox
run: python3 -m pip install tox
- name: 'run tox for docs-build-ci'
run: tox -e 'docs-build-ci'
- uses: actions/[email protected]
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@v2
- 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@v3
- name: Choose Python version 3.10
uses: actions/setup-python@v4
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__