This repository was archived by the owner on May 12, 2026. It is now read-only.
Repository navigation
128 lines (105 loc) · 3.33 KB
/
Copy pathrelease.yaml
File metadata and controls
128 lines (105 loc) · 3.33 KB
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
128
name: Publish to PyPI and Deploy Docs
permissions:
contents: read
on:
release:
types: [published]
jobs:
build-wheel:
outputs:
wheel_name: ${{ steps.build_step.outputs.wheel_name }}
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0 # we need the full history and tags for versioning
fetch-tags: 'true'
- name: Build Hidet Wheel
id: build_step
uses: ./.github/actions/build-wheel
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build_step.outputs.wheel_name }}
path: ${{ steps.build_step.outputs.wheel_path }}
retention-days: 1
if-no-files-found: "error"
list-test-dirs:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout Hidet
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- id: set-matrix
run: |
python .github/scripts/set_test_matrix.py
run-tests:
name: Release Tests
needs: [list-test-dirs, build-wheel]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.list-test-dirs.outputs.matrix) }}
runs-on: linux-amd64-gpu-l4-latest-1
container:
image: nvidia/cuda:12.6.2-devel-ubuntu22.04
steps:
- name: Install dependencies via apt
run: |
apt update && DEBIAN_FRONTEND=noninteractive apt install -y ccache git graphviz graphviz-dev
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Download wheel
uses: actions/download-artifact@v4
with:
name: ${{ needs.build-wheel.outputs.wheel_name }}
- name: Setup Hidet from Wheel
run: |
pip install ${{ needs.build-wheel.outputs.wheel_name }}[dev]
- name: List installed packages
run: |
pip list
- name: Run tests
run: |
rm -rf ~/.config/hidet
python -m pytest -v --durations=20 --clear-cache ${{ matrix.path }}
build-docs:
name: Build and Deploy Docs
runs-on: linux-amd64-gpu-l4-latest-1
container:
image: us-east4-docker.pkg.dev/github-workflow-runners/hidet-base-ci/hidet-base-ci:latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Build and deploy release docs
uses: ./.github/actions/build-docs
with:
docs_deploy_token: ${{ secrets.WEBSITE_REPO_TOKEN }}
update_docs: true
publish:
name: Publish to PyPI
needs: [run-tests, build-docs, build-wheel]
if: github.event_name == 'release' && github.event.action == 'published' && startsWith(github.event.release.tag_name, 'v')
runs-on: ubuntu-latest
steps:
- name: Download wheel
uses: actions/download-artifact@v4
with:
name: ${{ needs.build-wheel.outputs.wheel_name }}
- name: Show the wheel
run: |
ls -l
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: ./