Skip to content

Run tests also on windows arm runners #4577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 57 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ jobs:
matrix:
rust: ["stable"]
backend: ["postgres", "sqlite", "mysql"]
os: [ubuntu-latest, macos-13, macos-15, windows-2025, ubuntu-22.04-arm]
os:
[
ubuntu-latest,
macos-13,
macos-15,
windows-2025,
ubuntu-22.04-arm,
windows-11-arm,
]
include:
- rust: "beta"
backend: "postgres"
Expand Down Expand Up @@ -145,7 +153,7 @@ jobs:
echo "MYSQLCLIENT_VERSION=8.4" >> $GITHUB_ENV

- name: Install sqlite (Windows)
if: runner.os == 'Windows' && matrix.backend == 'sqlite'
if: matrix.os == 'windows-2025' && matrix.backend == 'sqlite'
shell: cmd
run: |
choco install sqlite
Expand All @@ -154,15 +162,24 @@ jobs:
lib /machine:x64 /def:sqlite3.def /out:sqlite3.lib

- name: Set variables for sqlite (Windows)
if: runner.os == 'Windows' && matrix.backend == 'sqlite'
if: matrix.os == 'windows-2025' && matrix.backend == 'sqlite'
shell: bash
run: |
echo "C:\ProgramData\chocolatey\lib\SQLite\tools" >> $GITHUB_PATH
echo "SQLITE3_LIB_DIR=C:\ProgramData\chocolatey\lib\SQLite\tools" >> $GITHUB_ENV
echo "SQLITE_DATABASE_URL=C:\test.db" >> $GITHUB_ENV

- name: Install sqlite (Windows ARM)
if: matrix.os == 'windows-11-arm' && matrix.backend == 'sqlite'
shell: bash
run: |
vcpkg install sqlite3
echo "SQLITE3_LIB_DIR=C:/vcpkg/packages/sqlite3_arm64-windows/lib" >> $GITHUB_ENV
echo "SQLITE3_LIB_DIR=C:/vcpkg/packages/sqlite3_arm64-windows/lib" >> $GITHUB_PATH
echo "SQLITE_DATABASE_URL=C:\test.db" >> $GITHUB_ENV

- name: Install postgres (Windows)
if: runner.os == 'Windows' && matrix.backend == 'postgres'
if: matrix.os == 'windows-2025' && matrix.backend == 'postgres'
shell: bash
run: |
choco install postgresql14 --force --params '/Password:root'
Expand All @@ -172,6 +189,20 @@ jobs:
echo "PG_DATABASE_URL=postgres://postgres:root@localhost/" >> $GITHUB_ENV
echo "PG_EXAMPLE_DATABASE_URL=postgres://postgres:root@localhost/diesel_example" >> $GITHUB_ENV

- name: Install postgres (Windows ARM)
if: matrix.os == 'windows-11-arm' && matrix.backend == 'postgres'
shell: bash
run: |
choco install postgresql14 --force --params '/Password:root'
vcpkg install libpq
dir "C:/vcpkg/packages/libpq_arm64-windows/lib"
dir "C:/vcpkg/packages/libpq_arm64-windows/bin"
echo "PQ_LIB_DIR=C:/vcpkg/packages/libpq_arm64-windows/lib" >> $GITHUB_ENV
echo "C:/vcpkg/packages/libpq_arm64-windows/lib" >> $GITHUB_PATH
echo "C:/vcpkg/packages/libpq_arm64-windows/bin" >> $GITHUB_PATH
echo "PG_DATABASE_URL=postgres://postgres:root@localhost/" >> $GITHUB_ENV
echo "PG_EXAMPLE_DATABASE_URL=postgres://postgres:root@localhost/diesel_example" >> $GITHUB_ENV

- name: Install mysql (Windows)
if: runner.os == 'Windows' && matrix.backend == 'mysql'
shell: bash
Expand All @@ -183,8 +214,6 @@ jobs:
"C:\\Program Files\\MySQL\\MySQL Server 8.0\\bin\\mysql" -e "create database diesel_test;" -u root
"C:\\Program Files\\MySQL\\MySQL Server 8.0\\bin\\mysql" -e "create database diesel_unit_test;" -u root
"C:\\Program Files\\MySQL\\MySQL Server 8.0\\bin\\mysql" -e 'grant all on `diesel_%`.* to 'root'@'localhost';' -uroot
# remove doxygen because mysqlclient build otherwise breaks?
rm "C:/Strawberry/c/bin/doxygen.exe"
echo "OPENSSL_RUST_USE_NASM=0" >> $GITHUB_ENV
echo OPENSSL_SRC_PERL=C:/Strawberry/perl/bin/perl >> $GITHUB_ENV
echo "MYSQL_DATABASE_URL=mysql://[email protected]/diesel_test" >> $GITHUB_ENV
Expand All @@ -196,6 +225,28 @@ jobs:
echo "C:\Program Files\MySQL\MySQL Server 8.0\bin" >> $GITHUB_PATH
dir "C:\Program Files\MySQL\MySQL Server 8.0\lib"

- name: Install mysqlcient (Windows ARM)
if: matrix.os == 'windows-11-arm' && matrix.backend == 'mysql'
shell: bash
run: |
vcpkg install libmysql

- name: Remove doxygen (Windows)
if: matrix.os == 'windows-2025' && matrix.backend == 'mysql'
shell: bash
run: |
# remove doxygen because mysqlclient build otherwise breaks?
rm "C:/Strawberry/c/bin/doxygen.exe"

- name: Install rustup
if: matrix.os == 'windows-11-arm'
shell: pwsh
run: |
Invoke-WebRequest -Uri "https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe" -OutFile rustup-init.exe
.\rustup-init.exe --default-toolchain none -y
"$env:USERPROFILE\.cargo\bin" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
"CARGO_HOME=$env:USERPROFILE\.cargo" | Out-File -Append -Encoding ascii $env:GITHUB_ENV

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
Expand Down
Loading