-
Notifications
You must be signed in to change notification settings - Fork 6
114 lines (98 loc) · 3.37 KB
/
ci.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
on: [push, pull_request]
name: Continuous Integration
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: check
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -A clippy::unnecessary_wraps
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-14]
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y && yum install -y openssl-devel"
CIBW_SKIP: "cp36-* cp37-* pp* *-win32 *-pypy* *-musllinux*"
CIBW_TEST_SKIP: "cp38-macosx_*:arm64"
# Build separate wheels for macOS's different architectures.
CIBW_ARCHS_MACOS: "arm64"
# Build only on Linux architectures that don't need qemu emulation.
CIBW_ARCHS_LINUX: "x86_64 aarch64"
# Run the test suite after each build.
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"'
CIBW_TEST_REQUIRES: "pytest"
CIBW_TEST_COMMAND: pytest {package}/tests
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- if: runner.os == 'Windows'
run: |
echo 'PATH=/c/Python38:/c/Python38/Scripts:$PATH' >> $GITHUB_ENV
echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >> $GITHUB_ENV
echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >> $GITHUB_ENV
echo 'CIBW_BEFORE_BUILD=python -m pip install --upgrade pip' >> $GITHUB_ENV
- if: runner.os != 'Linux'
name: Setup env when not using docker
run: |
python -m pip install --upgrade wheel setuptools
- uses: PyO3/maturin-action@v1
with:
working-directory: ./pyscandir
command: build
args: --release
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: pip
cache-dependency-path: ".github/workflows/wheels.yml"
- name: Install dependencies
run: |
python -m pip install cibuildwheel
python -m pip install -U twine
- name: Build wheels
run: |
cd pyscandir
maturin build --sdist --interpreter
python -m cibuildwheel --output-dir wheelhouse
- name: Upload as build artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels/*.whl
if-no-files-found: error
- name: Publish package to TestPyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: |
twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing target/wheels/*