Skip to content

Commit 7a70740

Browse files
committed
add Windows CI
1 parent efbad24 commit 7a70740

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/workflows/tests.yml

+73
Original file line numberDiff line numberDiff line change
@@ -579,3 +579,76 @@ jobs:
579579

580580
- name: Stop sccache server
581581
run: sccache --stop-server || true
582+
583+
build_windows:
584+
name: Windows build & test
585+
needs: lintck
586+
runs-on: ${{ matrix.os }}
587+
if: "!contains(github.event.head_commit.message, 'nogha')"
588+
env:
589+
RUSTC_WRAPPER: sccache
590+
SCCACHE_DIR: C:\Users\runneradmin\sccache
591+
SCCACHE_IDLE_TIMEOUT: 0
592+
PG_VER: ${{ matrix.postgresql }}
593+
594+
strategy:
595+
matrix:
596+
os: [ "windows-2022" ]
597+
postgresql: [ 13, 17 ]
598+
599+
steps:
600+
- uses: actions/checkout@v4
601+
602+
- name: Set up prerequisites and environment
603+
run: |
604+
Write-Output ""
605+
606+
echo "----- Install sccache -----"
607+
Invoke-WebRequest -Uri "https://github.com/mozilla/sccache/releases/download/v0.5.4/sccache-v0.5.4-x86_64-pc-windows-msvc.tar.gz" -OutFile "sccache.tar.gz"
608+
tar -xzvf sccache.tar.gz
609+
Move-Item -Force "sccache-v0.5.4-x86_64-pc-windows-msvc\sccache.exe" -Destination "C:\Windows\System32"
610+
New-Item -ItemType Directory -Force -Path $env:SCCACHE_DIR | Out-Null
611+
sccache --version
612+
613+
Write-Output "----- Outputting env -----"
614+
Get-ChildItem Env:
615+
Write-Output ""
616+
617+
618+
- name: Cache sccache directory
619+
uses: actions/cache@v4
620+
continue-on-error: false
621+
with:
622+
path: C:\Users\runneradmin\sccache
623+
key: pgrx-sccache-${{matrix.os}}-${{ hashFiles('**/Cargo.lock', '.github/workflows/tests.yml', '.cargo/config.toml') }}
624+
625+
- name: Cache cargo directory
626+
uses: actions/cache@v4
627+
with:
628+
path: |
629+
~/.cargo
630+
key: pgrx-cargo-${{matrix.os}}-tests-${{ hashFiles('**/Cargo.lock', '.github/workflows/tests.yml', '.cargo/config.toml') }}
631+
632+
- name: Start sccache server
633+
run: sccache --start-server
634+
635+
- name: Print sccache stats
636+
run: sccache --show-stats
637+
638+
- name: Install cargo-pgrx
639+
run: cargo install --path cargo-pgrx/ --debug --force
640+
641+
- name: Print sccache stats
642+
run: sccache --show-stats
643+
644+
- name: Run 'cargo pgrx init'
645+
run: cargo pgrx init --pg$env:PG_VER=download
646+
647+
- name: Run tests
648+
run: cargo test --all --no-default-features --features "pg$env:PG_VER pg_test cshim proptest" --all-targets
649+
650+
- name: Print sccache stats
651+
run: sccache --show-stats
652+
653+
- name: Stop sccache server
654+
run: sccache --stop-server || true

0 commit comments

Comments
 (0)