Repository navigation
Update package manifest schema #9
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: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| ci: | |
| name: ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| CGO_ENABLED: '1' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| - macos-latest | |
| defaults: | |
| run: | |
| shell: pwsh | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Configure MinGW | |
| if: runner.os == 'Windows' | |
| run: | | |
| $compiler = Get-Command gcc -ErrorAction Stop | |
| "CC=$($compiler.Source)" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
| & $compiler.Source --version | |
| - name: Check formatting | |
| if: matrix.os == 'ubuntu-latest' # Formatting check is platform-agnostic, so only run it once to save time | |
| run: | | |
| $unformatted = gofmt -l . | |
| if ($unformatted) { | |
| Write-Error "The following Go files are not gofmt-formatted:" | |
| $unformatted | |
| exit 1 | |
| } | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Test | |
| run: go test ./... | |
| - name: Race test | |
| run: go test -race ./... | |
| - name: Build | |
| run: | | |
| New-Item -ItemType Directory -Force dist | Out-Null | |
| $ext = if ($env:RUNNER_OS -eq 'Windows') { '.exe' } else { '' } | |
| go build -v -o "dist/dspm$ext" ./cmd/dspm | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dspm-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }} | |
| path: dist/* | |
| if-no-files-found: error |