-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (71 loc) · 2.37 KB
/
ci.yml
File metadata and controls
87 lines (71 loc) · 2.37 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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
with:
toolchain: nightly
components: clippy
- run: cargo clippy --release -- -D warnings
rust-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
with:
toolchain: stable
- run: cargo test
php-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
php-version: ['8.1', '8.2', '8.3', '8.4', '8.5']
name: PHP ${{ matrix.php-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
with:
toolchain: stable
components: rustfmt
- uses: shivammathur/setup-php@fcafdd6392932010c2bd5094439b8e33be2a8a09 # v2.37.0
with:
php-version: ${{ matrix.php-version }}
tools: composer
- name: Set rustfmt for bindgen (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
rustup component add rustfmt
$rustfmt = & rustup which rustfmt
echo "RUSTFMT=$rustfmt" >> $env:GITHUB_ENV
- run: composer install --no-interaction
- run: cargo build --release
- name: Run PHPUnit (Linux)
if: runner.os == 'Linux'
run: |
EXT=$(pwd)/target/release/libpqcrypto.so
php -d "extension=${EXT}" vendor/bin/phpunit
- name: Run PHPUnit (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
EXT_DIR="$(php -r "echo ini_get('extension_dir');")"
cp target/release/pqcrypto.dll "${EXT_DIR}/pqcrypto.dll"
echo "extension=pqcrypto" >> "$(php -r "echo php_ini_loaded_file();")"
php -m | grep pqcrypto
php vendor/bin/phpunit