Skip to content

Pin GitHub Actions to commit SHAs (#98) #513

Pin GitHub Actions to commit SHAs (#98)

Pin GitHub Actions to commit SHAs (#98) #513

Workflow file for this run

name: "CI"
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: './go.mod'
- name: Cache Go modules
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3.5.0
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Dependencies
run: go mod download
- name: Verify go.mod and go.sum
run: |
go mod tidy
git diff --exit-code || (echo "go.mod or go.sum is not clean! Run 'go mod tidy' and commit the changes." && exit 1)
- name: Install Tools
run: |
make install-tools
- name: Display Go version
run: go version
- name: Build
run: make build
- name: Check Formatting
run: |
make pretty
git diff --exit-code || (echo "Code is not formatted correctly! Run 'make pretty' and commit the changes." && exit 1)
- name: Run Linting
run: make lint
- name: Install go-junit-report
run: go install github.com/jstemmer/go-junit-report@latest
- name: Run Tests and Convert to JUnit
run: go test -v ./... | go-junit-report > report.xml
- name: Test Summary
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
with:
paths: "report.xml"
show: "fail"