-
Notifications
You must be signed in to change notification settings - Fork 70
103 lines (96 loc) · 3.16 KB
/
python.yml
File metadata and controls
103 lines (96 loc) · 3.16 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
---
name: Tensornet
on:
push:
branches:
- '**' # matches every branch
tags:
- 'v[0-9]+'
- 'v[0-9]+.[a-z0-9]+'
- 'v[0-9]+.[0-9]+.[a-z0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+.[a-z0-9]+'
pull_request:
env:
PIXI_LOCKED: "true"
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.8.5
with:
pixi-version: v0.49.0
environments: tools
- name: pre-commit
run: ./pixiw run pre-commit-run --color=always --show-diff-on-failure
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.8.5
with:
pixi-version: v0.49.0
environments: default protoc py37 py38 py39
- name: Build with debug profile
run: ./pixiw run build
- name: Verify that the dynamic libraries only requires glibc <= 2.12
run: |
err=0
objdump -T build/debug/libtensornet.so | grep GLIBC_ | grep -v '0000000000000000\s*w\s*DF' | grep -v 'GLIBC_\([01]\|2\.[0-9]\|2\.1[012]\)[^0-9]' || err=$?
test $err = 1
err=0
objdump -T build/debug/_pywrap_tn.cpython-38-x86_64-linux-gnu.so | grep GLIBC_ | grep -v '0000000000000000\s*w\s*DF' | grep -v 'GLIBC_\([01]\|2\.[0-9]\|2\.1[012]\)[^0-9]' || err=$?
test $err = 1
create-wheel-cmake:
name: create wheel / cmake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.8.5
with:
pixi-version: v0.49.0
environments: default py37 py38 py39 tools
- name: Create wheel
run: |
./pixiw run create-wheel
./pixiw run -e tools check-wheel-contents dist
grep -q '^tensornet$' qihoo_tensornet.egg-info/top_level.txt
ls -alh dist
- name: Store wheels
uses: actions/upload-artifact@v4
with:
path: dist/
retention-days: 7
publish-to-pypi:
name: Upload to pypi
if: github.repository == 'Qihoo360/tensornet' && startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- create-wheel-cmake
runs-on: ubuntu-latest
permissions:
id-token: write # mandatory for pypi trusted publishing
contents: write # mandatory for create a github release
steps:
- name: Download wheels
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# push v*.rc* tags to test.pypi.org
repository-url: ${{ contains(github.ref, '.rc') && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/'
}}
print-hash: true
- name: Create a draft release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: ${{ contains(github.ref, '.rc') }}
generate_release_notes: true