feat: add mTLS client certificate support #241
Workflow file for this run
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: Go | |
| on: | |
| push: | |
| branches: ['trunk'] | |
| pull_request: | |
| branches: ['trunk'] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build and test ${{matrix.os}} go${{matrix.go-version}} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| go-version: ['1.24', '1.25'] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Vet | |
| run: go vet -v ./... | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v8 | |
| with: | |
| version: v2.1 | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Install Spice (https://install.spiceai.org) (Linux) | |
| if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| curl https://install.spiceai.org | /bin/bash | |
| echo "$HOME/.spice/bin" >> $GITHUB_PATH | |
| $HOME/.spice/bin/spice install | |
| - name: install Spice (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| curl -L "https://install.spiceai.org/Install.ps1" -o Install.ps1 && PowerShell -ExecutionPolicy Bypass -File ./Install.ps1 | |
| - name: add Spice bin to PATH (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| Add-Content $env:GITHUB_PATH (Join-Path $HOME ".spice\bin") | |
| shell: pwsh | |
| - name: Init and start spice app (Unix) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| spice init spice_qs | |
| cd spice_qs | |
| spice add spiceai/quickstart | |
| spice run &> spice.log & | |
| # Wait for Spice to be ready | |
| echo "Waiting for Spice to be ready..." | |
| for i in {1..60}; do | |
| if curl -s http://localhost:8090/v1/ready 2>/dev/null | grep -q "ready"; then | |
| echo "Spice is ready!" | |
| break | |
| fi | |
| echo "Waiting... ($i/60)" | |
| sleep 1 | |
| done | |
| - name: Init and start spice app (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| spice install | |
| spice init spice_qs | |
| cd spice_qs | |
| spice add spiceai/quickstart | |
| $spicedPath = Join-Path $HOME ".spice\bin\spiced" | |
| Start-Process -FilePath $spicedPath -WorkingDirectory (Get-Location) -RedirectStandardOutput "spice.log" -RedirectStandardError "spice.err.log" | |
| # Wait for Spice to be ready | |
| Write-Host "Waiting for Spice to be ready..." | |
| for ($i = 1; $i -le 60; $i++) { | |
| try { | |
| $response = Invoke-WebRequest -Uri "http://localhost:8090/v1/ready" -UseBasicParsing -ErrorAction Stop | |
| if ($response.Content -match "ready") { | |
| Write-Host "Spice is ready!" | |
| break | |
| } | |
| } catch { | |
| # Ignore errors, keep waiting | |
| } | |
| Write-Host "Waiting... ($i/60)" | |
| Start-Sleep -Seconds 1 | |
| } | |
| shell: pwsh | |
| - name: Test | |
| env: | |
| SPICE_API_KEY: ${{ secrets.SPICE_CLOUD_API_KEY }} | |
| run: go test -v ./... | |
| - name: Print Spice logs (Unix) | |
| if: always() && matrix.os != 'windows-latest' | |
| run: | | |
| echo "=== Spice Runtime Logs ===" | |
| cat spice_qs/spice.log || echo "No log file found" | |
| - name: Print Spice logs (Windows) | |
| if: always() && matrix.os == 'windows-latest' | |
| run: | | |
| Write-Host "=== Spice Runtime Logs (stdout) ===" | |
| Get-Content spice_qs\spice.log -ErrorAction SilentlyContinue | |
| Write-Host "=== Spice Runtime Logs (stderr) ===" | |
| Get-Content spice_qs\spice.err.log -ErrorAction SilentlyContinue | |
| shell: pwsh |