Debian Codegraph @

.github/workflows/test.yml

raw
1 on:
2 push:
3 pull_request:
4 schedule:
5 - cron: '30 13 * * *'
6 permissions: { }
7 jobs:
8 test:
9 strategy:
10 fail-fast: false
11 matrix:
12 os:
13 - 'ubuntu-22.04'
14 - 'ubuntu-22.04-arm'
15 - 'macos-13'
16 - 'macos-14'
17 - 'windows-2022'
18 - 'windows-11-arm'
19 py:
20 - '3.9'
21 - '3.10'
22 - '3.11'
23 - '3.12'
24 - '3.13'
25 - '3.13t'
26 - '3.14'
27 - '3.14t'
28 arch:
29 - 'arm64'
30 - 'x86'
31 - 'x64'
32 exclude:
33 - os: 'ubuntu-22.04'
34 arch: 'arm64'
35 - os: 'ubuntu-22.04'
36 arch: 'x86'
37 - os: 'ubuntu-22.04-arm'
38 arch: 'x86'
39 - os: 'ubuntu-22.04-arm'
40 arch: 'x64'
41 - os: 'macos-13'
42 arch: 'arm64'
43 - os: 'macos-13'
44 arch: 'x86'
45 - os: 'macos-14'
46 arch: 'x86'
47 - os: 'macos-14'
48 arch: 'x64'
49 - os: 'macos-14'
50 arch: 'arm64'
51 py: '3.9'
52 - os: 'windows-2022'
53 arch: 'arm64'
54 - os: 'windows-11-arm'
55 arch: 'x86'
56 - os: 'windows-11-arm'
57 arch: 'x64'
58 - os: 'windows-11-arm'
59 py: '3.8'
60 - os: 'windows-11-arm'
61 py: '3.9'
62 - os: 'windows-11-arm'
63 py: '3.10'
64
65 runs-on: ${{ matrix.os }}
66 env:
67 # Enable fuzzing tests, other expensive tests.
68 ZSTD_SLOW_TESTS: '1'
69 # Make all compile warnings fatal except on 3.13, which has some deprecations
70 # at the moment.
71 ZSTD_WARNINGS_AS_ERRORS: '1'
72 # More thorough fuzzing coverage.
73 HYPOTHESIS_PROFILE: 'ci'
74 # Activate Python development mode so we get warnings.
75 PYTHONDEVMODE: '1'
76 steps:
77 - name: Set up Python
78 uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
79 with:
80 python-version: ${{ matrix.py }}
81 architecture: ${{ matrix.arch }}
82 allow-prereleases: true
83
84 - name: Install Rust
85 if: matrix.arch != 'x86'
86 uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # v1
87 with:
88 toolchain: stable
89
90 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
91 with:
92 persist-credentials: false
93
94 - name: Install uv
95 uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 # v6.5.0
96 with:
97 version: "0.8.11"
98
99 - name: Test C Backend
100 run: |
101 uv -v run --locked pytest --numprocesses=auto --hypothesis-profile=${HYPOTHESIS_PROFILE} -v
102
103 - name: Test CFFI Backend
104 if: matrix.py != '3.13t'
105 env:
106 PYTHON_ZSTANDARD_IMPORT_POLICY: 'cffi'
107 run: |
108 uv -v run --locked -w cffi pytest --numprocesses=auto --hypothesis-profile=${HYPOTHESIS_PROFILE} -v
109
110 - name: Test Rust Backend
111 if: matrix.arch != 'x86'
112 # Rust backend is currently experimental. So ignore failures in it.
113 continue-on-error: true
114 env:
115 PYTHON_ZSTANDARD_IMPORT_POLICY: 'rust'
116 run: |
117 # We need --reinstall to get uv to pick up the config settings change.
118 # Unsure if this is a bug.
119 uv -v run --locked --config-settings-package 'zstandard:--global-option=--rust-backend' --reinstall pytest --numprocesses=auto --hypothesis-profile=${HYPOTHESIS_PROFILE} -v