Skip to content

Commit 0a1c0f2

Browse files
ci: fix (and test) windows builds
1 parent 1812d69 commit 0a1c0f2

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

.cargo/config.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[target.x86_64-pc-windows-msvc]
2-
rustflags = ["-C", "linker=rust-lld"]
2+
linker = "rust-lld"
3+
4+
[target.i686-pc-windows-msvc]
5+
linker = "rust-lld"

.github/workflows/ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
lint:
13-
runs-on: ubuntu-latest
13+
runs-on: ${{ matrix.os }}
1414
steps:
1515
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1616
with:
@@ -40,7 +40,9 @@ jobs:
4040
runs-on: ubuntu-latest
4141
strategy:
4242
matrix:
43+
os: [ubuntu-latest, windows-latest]
4344
php-version: ['8.1', '8.2', '8.3', '8.4', '8.5']
45+
name: PHP ${{ matrix.php-version }} on ${{ matrix.os }}
4446
steps:
4547
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4648
with:
@@ -49,6 +51,7 @@ jobs:
4951
- uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9
5052
with:
5153
toolchain: stable
54+
components: rustfmt
5255

5356
- uses: shivammathur/setup-php@fcafdd6392932010c2bd5094439b8e33be2a8a09 # v2.37.0
5457
with:
@@ -59,7 +62,18 @@ jobs:
5962

6063
- run: cargo build --release
6164

62-
- name: Run PHPUnit
65+
- name: Run PHPUnit (Linux)
66+
if: runner.os == 'Linux'
6367
run: |
6468
EXT=$(pwd)/target/release/libpqcrypto.so
6569
php -d "extension=${EXT}" vendor/bin/phpunit
70+
71+
- name: Run PHPUnit (Windows)
72+
if: runner.os == 'Windows'
73+
shell: bash
74+
run: |
75+
EXT_DIR="$(php -r "echo ini_get('extension_dir');")"
76+
cp target/release/pqcrytpto.dll "${EXT_DIR}/pqcryto.dll"
77+
echo "extension=pqcrypto" >> "$(php -r echo php_ini_loaded_file();")"
78+
php -m | grep pqcrypto
79+
php vendor/bin/phpunit

0 commit comments

Comments
 (0)