-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (46 loc) · 1.39 KB
/
test-codegen.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Generate and lint code
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
- name: Verify Patches
run: make patch-all
- name: Generate
run: |
make generate-all
# Expect all changes to be accounted for
! git status --porcelain | grep .
- name: Determine golangci-lint version
id: golangcilint
run: |
echo "${{github.actor}}"
line=$(grep GOLANGCI_LINT_VERSION= Makefile)
version=$(echo ${line} | cut -d = -f2)
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: ${{ steps.golangcilint.outputs.version }}
skip-cache: true
- name: Report tests check
# When this job is triggered with the automatic
# GitHub Actions token, we have to explicitly set
# the commit status
if: ${{ always() && github.event_name == 'workflow_dispatch' && github.actor == 'github-actions[bot]' }}
uses: myrotvorets/[email protected]
with:
context: test # This must be hard-coded to match the job name
status: ${{ job.status }}
sha: ${{ github.sha }}