| 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@v3 |
| - uses: arnested/go-version-action@6d27c5921683f55415260f7a285d330ddb146fa2 |
| id: versions |
| |
| run: |
| strategy: |
| 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@v3 |
| |
| - name: Setup - Go ${{ matrix.go-version }} |
| uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f |
| with: |
| go-version: ${{ matrix.go-version }} |
| |
| - name: Setup - Python |
| uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5 |
| 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@31ee804b8576ae49f6dc3caa22591bc5080e7920 |
| with: |
| path-to-profile: profile.cov |
| flag-name: Go-${{ matrix.go-version }} |
| parallel: true |
| |
| golangci: |
| strategy: |
| matrix: |
| go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }} |
| os: [ubuntu-latest, macos-latest, windows-latest] |
| runs-on: ${{ matrix.os }} |
| needs: get-go-versions |
| steps: |
| - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f |
| with: |
| go-version: ${{ matrix.go-version }} |
| - uses: actions/checkout@v3 |
| - name: golangci-lint |
| uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc |
| with: |
| version: v1.49.0 |
| args: --timeout 3m |