[CONFIG] [Github Actions] Docker flow, ACTIONS_RUNTIME_TOKEN env added. #764
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 CI Tests | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches: ["main"] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: ["main"] | |
workflow_dispatch: | |
env: | |
LOG_LEVEL: WARN | |
jobs: | |
build: | |
name: "Run CI" | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ | |
"windows-latest", | |
"ubuntu-latest", | |
"macOS-latest" | |
] | |
go: ["1.21.x", "1.22.x", "1.23.x"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Build | |
run: go build -v ./... | |
- name: Lint (gofmt) | |
run: gofmt -l . && echo '✔ Your code looks good.' | |
- name: Lint (go vet) | |
run: go vet -v ./... | |
- name: Lint golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
args: --timeout=10m | |
version: v1.60.3 | |
skip-cache: true | |
- name: Test | |
run: | | |
go test -v -coverprofile="coverage.out" ./exercises/... | |
# go tool cover -func=coverage.out |