name: CI on: push: branches: [ main ] pull_request: branches: [ main ] jobs: build: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version: '1.26' - name: Set up Node for native bridge tests uses: actions/setup-node@v4 with: node-version: '22' - name: Build run: go build -v ./... - name: Vet run: go vet ./... - name: Build test binary (Unix) if: matrix.os != 'windows-latest' run: | mkdir -p .build go build -o .build/grpvn ./cmd/grpvn echo "GRPVN_TEST_BIN=$PWD/.build/grpvn" >> "$GITHUB_ENV" - name: Build test binary (Windows) if: matrix.os == 'windows-latest' shell: pwsh run: | New-Item -ItemType Directory -Force -Path .build | Out-Null go build -o .build\grpvn.exe ./cmd/grpvn Add-Content -Path $env:GITHUB_ENV -Value "GRPVN_TEST_BIN=$pwd\.build\grpvn.exe" - name: Test run: go test -race -v ./... - name: Verify npm launcher run: node --test npm/test/launcher.test.js - name: Verify install.ps1 if: matrix.os == 'windows-latest' shell: pwsh run: | $null = [scriptblock]::Create((Get-Content -Raw install.ps1)) & .\tests\install_download_test.ps1 & .\install.ps1 -Version v0.6.0 -BinDir "$env:TEMP\grpvn-bin" & "$env:TEMP\grpvn-bin\grpvn.exe" version - name: Fmt if: matrix.os == 'ubuntu-latest' run: | gofmt -l . | tee /tmp/fmt.out test ! -s /tmp/fmt.out