chore(deps): bump actions/setup-go from 4 to 5 (#305) #777
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: Go [lint, test] | |
on: | |
push: | |
branches: | |
- "master" | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
branches: | |
- "*" | |
paths: | |
- "scripts/**" | |
- "tools/**" | |
- "**/*.go" | |
- "**/*.gohtml" | |
- "**/*.proto" | |
- "go.mod" | |
- "go.sum" | |
- "Makefile" | |
- "!**.*md" | |
- ".github/workflows/**" | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
max-parallel: 2 | |
matrix: | |
os: [ "ubuntu-22.04" ] | |
go: [ "1.20" ] | |
runs-on: ${{ matrix.os }} | |
name: Build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- run: | | |
go version | |
shell: bash | |
- name: Set up cache | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-vendored-tools-${{ secrets.CACHE_VERSION }} | |
with: | |
path: | | |
${{ env.GOBIN }} | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }} | |
- name: Install tools | |
run: | | |
make install-tools | |
shell: bash | |
- name: Build | |
run: | | |
make build | |
shell: bash | |
- name: Install GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
install-only: true | |
- name: Check release | |
run: | | |
make check-releaser | |
shell: bash | |
testing: | |
strategy: | |
fail-fast: false | |
max-parallel: 2 | |
matrix: | |
os: [ "ubuntu-22.04" ] | |
go: [ "1.20" ] | |
runs-on: ${{ matrix.os }} | |
name: Run Tests | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- run: | | |
go version | |
shell: bash | |
- name: Set up cache | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-vendored-tools-${{ secrets.CACHE_VERSION }} | |
with: | |
path: | | |
${{ env.GOBIN }} | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }} | |
- name: Install tools | |
run: | | |
make install-tools | |
shell: bash | |
- name: Test | |
run: | | |
make test | |
shell: bash | |
linting: | |
strategy: | |
fail-fast: false | |
max-parallel: 2 | |
matrix: | |
os: [ "ubuntu-22.04" ] | |
go: [ "1.20" ] | |
runs-on: ${{ matrix.os }} | |
name: Run linters | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- run: | | |
go version | |
shell: bash | |
- name: Vet | |
run: | | |
make vet | |
shell: bash | |
- name: Set up cache | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-vendored-tools-${{ secrets.CACHE_VERSION }} | |
with: | |
path: | | |
${{ env.GOBIN }} | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }} | |
- name: Install tools | |
run: | | |
make install-tools | |
shell: bash | |
- name: Lint | |
run: | | |
make lint-pipeline | |
shell: bash | |
reports: | |
needs: [ linting, testing, build ] | |
strategy: | |
fail-fast: true | |
max-parallel: 1 | |
matrix: | |
os: [ "ubuntu-22.04" ] | |
go: [ "1.20" ] | |
runs-on: ${{ matrix.os }} | |
name: Quality reports | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- run: | | |
go version | |
shell: bash | |
- name: Set up cache | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-vendored-tools-${{ secrets.CACHE_VERSION }} | |
with: | |
path: | | |
${{ env.GOBIN }} | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/tools/go.sum') }} | |
- name: Install tools | |
run: | | |
make install-tools | |
shell: bash | |
- name: Prepare test coverage | |
run: | | |
make prepare-cover-report | |
shell: bash | |
- name: Tests report | |
run: | | |
make test-sonar-report | |
shell: bash | |
- name: Prepare lint report | |
run: | | |
make lint-sonar | |
shell: bash | |
- name: Cover report upload | |
if: success() | |
run: | | |
bash <(curl -s https://codecov.io/bash) -f ./coverage/full.cov | |
shell: bash | |
- name: SonarCloud report upload | |
uses: sonarsource/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |