-
Notifications
You must be signed in to change notification settings - Fork 3
98 lines (98 loc) · 3.48 KB
/
test.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
name: Test
on:
push:
pull_request:
schedule: [{cron: '30 23 * * 6'}] # M H d m w (Sat at 23:30)
jobs:
clang-format:
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: {python-version: '3.x'}
- run: sudo apt-get install -yqq clang-format
- uses: pre-commit/[email protected]
with: {extra_args: --all-files clang-format}
test:
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
name: py${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.7, 3.11]
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: pip install -U -e .[dev]
run: make CXX_FLAGS='' deps-build build-editable deps-run
- run: make test
- uses: codecov/codecov-action@v4
- name: compile -Wall
run: make clean build-wheel
cuda:
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
name: CUDA py${{ matrix.python }}
runs-on: [self-hosted, cuda, python]
strategy:
matrix:
python: [3.7, 3.11]
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0}
- name: Run setup-python
run: setup-python -p${{ matrix.python }} 'cuda-version<12' 'cupy<13'
- name: pip install -U -e .[dev]
run: make CXX_FLAGS='' deps-build build-editable deps-run
- run: make test
- uses: codecov/codecov-action@v4
- name: compile -Wall
run: make CUDA_ARCHITECTURES=all clean build-wheel
- name: Post Run setup-python
run: setup-python -p${{ matrix.python }} -Dr
if: ${{ always() }}
deploy:
needs: [clang-format, test, cuda]
name: PyPI Deploy
environment: pypi
permissions: {contents: write, id-token: write}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN || github.token }}
- uses: actions/setup-python@v5
with: {python-version: '3.x'}
- id: dist
uses: casperdcl/deploy-pypi@v2
with:
build: -s
upload: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Release
run: |
changelog=$(git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD)
tag="${GITHUB_REF#refs/tags/}"
gh release create --title "CuVec $tag stable" --draft --notes "$changelog" "$tag" dist/${{ steps.dist.outputs.targz }}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Docs
run: |
pushd docs
pip install -U -r requirements.txt
PYTHONPATH=. pydoc-markdown --build --site-dir=../../../dist/site
popd
- if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') || github.event_name == 'workflow_dispatch' }}
uses: casperdcl/push-dir@v1
with:
message: update static site
branch: gh-pages
history: false
dir: dist/site
nojekyll: true
name: AMYPAD[bot]
email: [email protected]