-
Notifications
You must be signed in to change notification settings - Fork 172
176 lines (166 loc) · 5.88 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
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
name: CI
on:
pull_request: {}
push:
branches:
- main
tags:
- '*'
jobs:
macos:
runs-on: ${{ matrix.MACOS }}
strategy:
fail-fast: false
matrix:
PYTHON:
- {VERSION: "3.8"}
- {VERSION: "3.13"}
- {VERSION: "3.13t"}
MACOS:
- macos-13
- macos-latest
name: "Python ${{ matrix.PYTHON.VERSION }} on ${{ matrix.MACOS }}"
steps:
- uses: actions/[email protected]
- name: Setup python
id: setup-python
uses: quansight-labs/[email protected]
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- uses: actions/[email protected]
timeout-minutes: 5
with:
path: |
~/Library/Caches/pip/
~/.cargo/registry/cache/
~/.cargo/registry/src/
~/.cargo/git/db/
src/_bcrypt/target/
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: pip install tox
- run: tox --discover $(which python)
env:
CARGO_TARGET_DIR: ${{ format('{0}/src/_bcrypt/target/', github.workspace) }}
windows:
runs-on: windows-latest
strategy:
matrix:
WINDOWS:
- {ARCH: 'x86', WINDOWS: 'win32', RUST_TRIPLE: 'i686-pc-windows-msvc'}
- {ARCH: 'x64', WINDOWS: 'win64', RUST_TRIPLE: 'x86_64-pc-windows-msvc'}
PYTHON:
- {VERSION: "3.8"}
- {VERSION: "3.13"}
- {VERSION: "3.13t"}
name: "Python ${{ matrix.PYTHON.VERSION }} on ${{ matrix.WINDOWS.WINDOWS }}"
steps:
- uses: actions/[email protected]
- name: Setup python
id: setup-python
uses: quansight-labs/[email protected]
with:
python-version: ${{ matrix.PYTHON.VERSION }}
architecture: ${{ matrix.WINDOWS.ARCH }}
- uses: actions/[email protected]
timeout-minutes: 5
with:
path: |
~/AppData/Local/pip/Cache/
~/.cargo/bin/
~/.cargo/registry/cache/
~/.cargo/registry/src/
~/.cargo/git/db/
src/_bcrypt/target/
key: ${{ runner.os }}-${{ matrix.WINDOWS.ARCH }}-${{ steps.setup-python.outputs.python-version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: pip install tox
- run: tox --discover $(which python)
env:
CARGO_TARGET_DIR: ${{ format('{0}/src/_bcrypt/target/', github.workspace) }}
linux:
runs-on: ubuntu-22.04
strategy:
matrix:
PYTHON:
- {VERSION: "3.13", TOXENV: "pep8,packaging"}
- {VERSION: "3.13", TOXENV: "mypy"}
- {VERSION: "3.8"}
- {VERSION: "3.9"}
- {VERSION: "3.10"}
- {VERSION: "3.11"}
- {VERSION: "3.12"}
- {VERSION: "3.13"}
- {VERSION: "3.13t"}
- {VERSION: "pypy-3.9"}
- {VERSION: "pypy-3.10"}
# MSRV
- {VERSION: "3.13", RUST_VERSION: "1.64.0"}
- {VERSION: "3.13", RUST_VERSION: "beta"}
- {VERSION: "3.13", RUST_VERSION: "nightly"}
name: "${{ matrix.PYTHON.TOXENV || matrix.PYTHON.VERSION }} on linux, Rust ${{ matrix.PYTHON.RUST_VERSION || 'stable' }}"
steps:
- uses: actions/[email protected]
- name: Setup python
id: setup-python
uses: quansight-labs/[email protected]
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- uses: actions/[email protected]
timeout-minutes: 5
with:
path: |
~/.cache/pip/
~/.cargo/bin/
~/.cargo/registry/cache/
~/.cargo/registry/src/
~/.cargo/git/db/
src/_bcrypt/target/
key: ${{ runner.os }}-${{ matrix.PYTHON.VERSION }}-${{ steps.setup-python.outputs.python-version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
with:
toolchain: ${{ matrix.PYTHON.RUST_VERSION || 'stable' }}
- run: pip install tox
- run: tox --discover $(which python)
env:
TOXENV: ${{ matrix.PYTHON.TOXENV }}
CARGO_TARGET_DIR: ${{ format('{0}/src/_bcrypt/target/', github.workspace) }}
linux-distros:
runs-on: ${{ matrix.IMAGE.RUNNER }}
container: ghcr.io/pyca/cryptography-runner-${{ matrix.IMAGE.IMAGE }}
strategy:
matrix:
IMAGE:
- {IMAGE: "alpine", TOXENV: "py312", RUNNER: "ubuntu-latest"}
- {IMAGE: "alpine:aarch64", TOXENV: "py312", RUNNER: [self-hosted, Linux, ARM64]}
- {IMAGE: "ubuntu-rolling:aarch64", TOXENV: "py312", RUNNER: [self-hosted, Linux, ARM64]}
name: "${{ matrix.IMAGE.TOXENV }} on ${{ matrix.IMAGE.IMAGE }}"
steps:
- name: Ridiculous alpine workaround for actions support on arm64
run: |
# This modifies /etc/os-release so the JS actions
# from GH can't detect that it's on alpine:aarch64. It will
# then use a glibc nodejs, which works fine when gcompat
# is installed in the container (which it is)
sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release
if: matrix.IMAGE.IMAGE == 'alpine:aarch64'
- uses: actions/[email protected]
with:
persist-credentials: false
- run: /venv/bin/pip install tox
- run: '/venv/bin/tox'
env:
TOXENV: ${{ matrix.IMAGE.TOXENV }}
RUSTUP_HOME: /root/.rustup
CARGO_TARGET_DIR: ${{ format('{0}/src/_bcrypt/target/', github.workspace) }}
all-green: # This job does nothing and is only used for the branch protection
if: always()
needs:
- macos
- windows
- linux
- linux-distros
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
with:
jobs: ${{ toJSON(needs) }}