CI #8
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: CI | |
on: | |
pull_request: | |
types: [opened, edited, synchronize, reopened] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: {} | |
jobs: | |
golangci: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22 | |
cache: true | |
cache-dependency-path: go.sum | |
- name: golangci-lint | |
uses: golangci/[email protected] | |
with: | |
version: v1.60.2 | |
test: | |
name: Run tests and collect coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22 | |
- name: Run Tests | |
run: make test | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: ./cover.out | |
token: ${{ secrets.CODECOV_TOKEN }} | |
validate-generated: | |
name: Validate generated files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22 | |
- name: run code generators | |
run: make generate | |
- name: run manifest generators | |
run: make manifests | |
- name: ensure no files changed | |
run: git diff --exit-code || (echo "Generated files are out of sync. Please run 'make generate manifests' and commit the updated files."; exit 1) |