-
Notifications
You must be signed in to change notification settings - Fork 2
181 lines (174 loc) · 5.68 KB
/
Copy pathpython.yml
File metadata and controls
181 lines (174 loc) · 5.68 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Python Unit Test
on:
push:
branches: ["main", "develop"]
pull_request:
types: [opened, synchronize, reopened]
jobs:
build-shared-library:
strategy:
matrix:
include:
# ubuntu-22.04 runner + debian:bullseye Docker (Debian 11, GLIBC 2.31)
# to maintain the same GLIBC compatibility as the old ubuntu-20.04 build.
# Go 1.25.x has no official bullseye image, so we install the Go
# toolchain from the official tarball on top of debian:bullseye.
- runs-on: ubuntu-22.04
filename: pyfastexcel.so
- runs-on: windows-latest
filename: pyfastexcel.dll
- runs-on: macos-14
filename: pyfastexcel.dylib
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Set up Golang
if: runner.os != 'Linux'
uses: actions/setup-go@v5
with:
go-version: '1.25'
check-latest: true
- name: Build shared library (Linux)
if: runner.os == 'Linux'
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
debian:bullseye \
bash -c "set -e && \
apt-get update -q && apt-get install -y gcc make curl git -q && \
curl -sSL -o /tmp/go.tar.gz https://go.dev/dl/go1.25.12.linux-amd64.tar.gz && \
echo '234828b7a89e0e303d2556310ee549fbcf253d28de937bac3da13d6294262ac1 /tmp/go.tar.gz' | sha256sum -c - && \
tar -C /usr/local -xzf /tmp/go.tar.gz && \
export PATH=\$PATH:/usr/local/go/bin && \
git config --global --add safe.directory /workspace && \
CGO_ENABLED=1 make"
- name: Build shared library
if: runner.os != 'Linux'
run: |
go env -w CGO_ENABLED="1"
make
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.runs-on }}-shared-library
path: ./pyfastexcel/${{ matrix.filename }}
python-test-ubuntu:
name: py-unittest-ubuntu
needs: [build-shared-library]
strategy:
max-parallel: 5
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
include:
- python-version: "3.14"
experimental: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- run: |
mv ./pyfastexcel.so ./pyfastexcel
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: ${{ matrix.experimental == true }}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Install dependencies
run: uv sync --dev
- name: Run tests to generate coverage statistics
run: uv run pytest
- name: Upload coverage to Codacy
if: github.event_name == 'push'
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r py_coverage.xml
- name: Upload coverage reports to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Zncl2222/pyfastexcel
files: ./py_coverage.xml
flags: python
name: python-3.11-ubuntu
disable_search: true
fail_ci_if_error: true
python-test-windows:
name: py-unittest-windows
needs: [build-shared-library]
strategy:
max-parallel: 5
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
include:
- python-version: "3.14"
experimental: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- run: |
mv ./pyfastexcel.dll ./pyfastexcel
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: ${{ matrix.experimental == true }}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Install dependencies
run: uv sync --dev
- name: Run tests
run: uv run pytest
python-test-macos:
name: py-unittest-macos
needs: [build-shared-library]
strategy:
max-parallel: 5
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
include:
- python-version: "3.14"
experimental: true
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- run: |
mv ./pyfastexcel.dylib ./pyfastexcel
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: ${{ matrix.experimental == true }}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Install dependencies
run: uv sync --dev
- name: Run tests
run: uv run pytest