Skip to content

Update github/super-linter action to v7 (#14) #7

Update github/super-linter action to v7 (#14)

Update github/super-linter action to v7 (#14) #7

Workflow file for this run

name: Go CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files_yaml: |
golang:
- '**/*.go'
- 'go.*'
- '.goreleaser.yml'
docker:
- 'Dockerfile'
- 'goreleaser.Dockerfile'
- name: Set up Go
uses: actions/setup-go@v5
if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
with:
go-version: 1.22
- name: Install dependencies
run: go mod tidy
if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
- name: Run tests
run: go test -v ./... -coverprofile=coverage.out
if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
if: steps.changed-files-yaml.outputs.test_any_changed == 'true'
with:
file: coverage.out