feat(shadictl): add git snapshot artifacts #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| jobs: | |
| build-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| env: | |
| PYO3_PYTHON: python | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Restore Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| - name: Install just | |
| if: runner.os == 'Windows' | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: just | |
| - name: Set OpenSSL env vars (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $candidates = @("C:\Program Files\OpenSSL-Win64", "C:\Program Files\OpenSSL", "C:\OpenSSL-Win64") | |
| $opensslDir = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1 | |
| if (-not $opensslDir) { | |
| choco install openssl -y --no-progress | |
| $opensslDir = "C:\Program Files\OpenSSL-Win64" | |
| } | |
| $libDir = if (Test-Path "$opensslDir\lib\VC\x64\MD") { "$opensslDir\lib\VC\x64\MD" } else { "$opensslDir\lib" } | |
| "OPENSSL_DIR=$opensslDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| "OPENSSL_LIB_DIR=$libDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| "OPENSSL_INCLUDE_DIR=$opensslDir\include" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y pkg-config nettle-dev | |
| - name: Install macOS dependencies | |
| if: runner.os == 'macOS' | |
| run: brew install python@3.12 nettle pkg-config | |
| - name: Set Python for PyO3 (macOS) | |
| if: runner.os == 'macOS' | |
| run: echo "PYO3_PYTHON=/opt/homebrew/opt/python@3.12/bin/python3.12" >> "$GITHUB_ENV" | |
| - name: Build and test | |
| if: runner.os != 'Windows' | |
| run: cargo test --workspace | |
| - name: Build and test (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: just windows-test |