-
Notifications
You must be signed in to change notification settings - Fork 4
119 lines (101 loc) · 3.33 KB
/
build_and_test_linux.yml
File metadata and controls
119 lines (101 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
name: Build and test Linux
permissions:
contents: read
on:
push:
branches:
- main
tags: "*"
pull_request:
env:
UV_FROZEN: true # https://docs.astral.sh/uv/configuration/environment/#uv_frozen
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build-wheels-linux:
name: Build 🛞
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
python-version: [ '3.11', '3.12', '3.13', '3.14' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
- name: Set IS_TAG environment variable
run: |
if [[ "${GITHUB_EVENT_NAME}" == "push" && "${GITHUB_REF}" == refs/tags/* ]]; then
echo "IS_TAG=true" >> $GITHUB_ENV
else
echo "IS_TAG=false" >> $GITHUB_ENV
fi
- name: build-wheels-linux
uses: docker://quay.io/pypa/manylinux_2_28_x86_64
env:
IS_TAG: ${{ env.IS_TAG }}
PYTHON_VERSION: ${{ matrix.python-version }}
GITHUB_REF_NAME: ${{ github.ref_name }}
with:
entrypoint: /bin/bash
args: '-c "sh wheel_build_scripts/build_wheels_linux.sh"'
- name: Upload wheel as artifact
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Python ${{ matrix.python-version }} wheel
path: |
graphite*.whl
test-linux:
needs: [build-wheels-linux]
strategy:
fail-fast: false
matrix:
python-version: [ '3.11', '3.12', '3.13', '3.14' ]
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Download wheel artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: "Python ${{ matrix.python-version }} wheel"
- name: Install wheel
run: |
# Find the downloaded wheel file
wheel_file=$(find . -name "graphite*.whl" -print -quit)
echo "Found wheel file @ $wheel_file"
# Install the wheel
pip install "$wheel_file"
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
- name: Run EnIF unit tests
run: |
python -m pip install pytest
pytest
pytest graphite_maps --doctest-modules
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build-wheels-linux, test-linux]
environment: pypi
permissions:
id-token: write
# If this is a tagged release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- name: Get wheels
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: artifacts
- name: Move to dist/
run: |
mkdir dist
find artifacts -name "*.whl" -exec mv '{}' dist/ \;
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0