on: workflow_call: name: Tests jobs: get-go-versions: name: Collect available Go versions runs-on: ubuntu-latest outputs: matrix: ${{ steps.versions.outputs.matrix }} steps: - uses: actions/checkout@v4 - uses: arnested/go-version-action@f3c61952b5f4cc7c74fb216df044634f6a59770f id: versions run: strategy: fail-fast: false # Keep running if one leg fails. matrix: os: [ubuntu-latest, macos-latest, windows-latest] go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }} runs-on: ${{ matrix.os }} needs: get-go-versions steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup - Go ${{ matrix.go-version }} uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe with: go-version: ${{ matrix.go-version }} - name: Setup - Python uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 with: python-version: "3.10" cache: "pip" cache-dependency-path: "requirements-test.txt" - name: Install Python dependencies run: | python3 -m pip install --upgrade pip python3 -m pip install --upgrade -r requirements-test.txt - name: Run tests run: go test -race -covermode atomic -coverprofile='profile.cov' ./... - name: Send coverage uses: shogo82148/actions-goveralls@7b1bd2871942af030d707d6574e5f684f9891fb2 with: path-to-profile: profile.cov flag-name: Go-${{ matrix.go-version }} parallel: true checks: strategy: matrix: go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }} runs-on: ubuntu-latest needs: get-go-versions steps: - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe with: go-version: ${{ matrix.go-version }} - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc with: version: v1.51 # has to be pinned and thus manually updated due to https://github.com/golangci/golangci-lint-action/blob/6a290f7d5d488e1e423b0b37fe802c822ca2c08c/README.md?plain=1#L108 args: --timeout 5m --verbose - name: govulncheck uses: golang/govulncheck-action@v1 with: go-version-input: ${{ matrix.go-version }} go-package: -json ./...