ci: pin task version #48
This file contains 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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
golangci: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
cache: false | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Setup Task | |
uses: arduino/setup-task@v1 | |
with: | |
version: "3.28.0" | |
- name: Download go mod dependencies | |
run: task mod:download | |
- name: Run tests | |
run: task test -- -race -covermode=atomic -coverprofile coverage.out | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: unit | |
integration: | |
name: integration | |
runs-on: ubuntu-latest | |
needs: | |
- golangci | |
- test | |
services: | |
dind: | |
image: docker:24.0-dind-rootless | |
ports: | |
- 2375:2375 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Setup Task | |
uses: arduino/setup-task@v1 | |
with: | |
version: "3.28.0" | |
- name: Download go mod dependencies | |
run: task mod:download | |
- name: Test with Docker | |
run: task test:integration -- -race -covermode=atomic -coverprofile coverage.out -coverpkg ./... | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: integration |