-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (46 loc) · 1.63 KB
/
ci.yml
File metadata and controls
48 lines (46 loc) · 1.63 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
name: CI
on:
pull_request:
jobs:
build-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
env:
PYO3_PYTHON: python
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Windows dependencies
if: runner.os == 'Windows'
shell: pwsh
run: |
$vcpkgRoot = $env:VCPKG_INSTALLATION_ROOT
if (-not $vcpkgRoot) { $vcpkgRoot = "C:\vcpkg" }
& "$vcpkgRoot\vcpkg.exe" install openssl:x64-windows nettle:x64-windows
choco install -y pkgconfiglite
"OPENSSL_DIR=$vcpkgRoot\installed\x64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"PKG_CONFIG_PATH=$vcpkgRoot\installed\x64-windows\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y pkg-config nettle-dev
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install python@3.12 nettle pkg-config
- name: Set Python for PyO3 (macOS)
if: runner.os == 'macOS'
run: echo "PYO3_PYTHON=/opt/homebrew/opt/python@3.12/bin/python3.12" >> "$GITHUB_ENV"
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Build and test
run: cargo test --workspace