name: Build on: push: pull_request: permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test: name: Test (${{ matrix.os }}) strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v5 - uses: actions/setup-go@v6 with: go-version-file: go.mod - shell: bash run: | go vet ./... go test -short ./... go build ./... cross: name: Cross-compile (${{ matrix.goos }}/${{ matrix.goarch }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - { goos: linux, goarch: arm64 } - { goos: linux, goarch: arm } - { goos: windows, goarch: amd64 } - { goos: darwin, goarch: amd64 } - { goos: darwin, goarch: arm64 } env: CGO_ENABLED: 0 GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} steps: - uses: actions/checkout@v5 - uses: actions/setup-go@v6 with: go-version-file: go.mod - run: go build ./... tags: name: Build tags runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - uses: actions/setup-go@v6 with: go-version-file: go.mod - name: vfw (windows) run: GOOS=windows go build -tags vfw ./... - name: libjpeg run: | sudo apt-get update sudo apt-get install -y libjpeg-dev CGO_ENABLED=1 go build -tags libjpeg ./...