Skip to content

Commit

Permalink
add Windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
usamoi committed Nov 2, 2024
1 parent 825cdf8 commit b182a94
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -579,3 +579,76 @@ jobs:

- name: Stop sccache server
run: sccache --stop-server || true

build_windows:
name: Windows build & test
needs: lintck
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'nogha')"
env:
RUSTC_WRAPPER: sccache
SCCACHE_DIR: C:\Users\runneradmin\sccache
SCCACHE_IDLE_TIMEOUT: 0
PG_VER: ${{ matrix.postgresql }}

strategy:
matrix:
os: [ "windows-latest" ]
postgresql: [ 17 ]

steps:
- uses: actions/checkout@v4

- name: Set up prerequisites and environment
run: |
Write-Output ""
echo "----- Install sccache -----"
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"
tar -xzvf sccache.tar.gz
Move-Item -Force "sccache-v0.5.4-x86_64-pc-windows-msvc\sccache.exe" -Destination "C:\Windows\System32"
New-Item -ItemType Directory -Force -Path $env:SCCACHE_DIR | Out-Null
sccache --version
Write-Output "----- Outputting env -----"
Get-ChildItem Env:
Write-Output ""
- name: Cache sccache directory
uses: actions/cache@v4
continue-on-error: false
with:
path: C:\Users\runneradmin\sccache
key: pgrx-sccache-${{matrix.os}}-${{ hashFiles('**/Cargo.lock', '.github/workflows/tests.yml', '.cargo/config.toml') }}

- name: Cache cargo directory
uses: actions/cache@v4
with:
path: |
~/.cargo
key: pgrx-cargo-${{matrix.os}}-tests-${{ hashFiles('**/Cargo.lock', '.github/workflows/tests.yml', '.cargo/config.toml') }}

- name: Start sccache server
run: sccache --start-server

- name: Print sccache stats
run: sccache --show-stats

- name: Install cargo-pgrx
run: cargo install --path cargo-pgrx/ --debug --force

- name: Print sccache stats
run: sccache --show-stats

- name: Run 'cargo pgrx init'
run: cargo pgrx init --pg$env:PG_VER=download

- name: Run tests
run: cargo test --all --no-default-features --features "pg$env:PG_VER pg_test cshim proptest" --all-targets

- name: Print sccache stats
run: sccache --show-stats

- name: Stop sccache server
run: sccache --stop-server || true

0 comments on commit b182a94

Please sign in to comment.