Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samlaf avs 538 make lint and fmt checks as part of ci #275

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/check-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: check that make fmt was run
on:
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
check-make-fmt:
name: check make fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: install go1.21
uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: Run make fmt
run: make fmt

- name: Check if make fmt generated changes that should be committed
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: make fmt generated changes that should be committed. Please run 'make fmt' and commit the changes."
git diff
git status
exit 1
fi
11 changes: 7 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4

- name: install go 1.21
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: "1.21"

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout 3m
args: --timeout 3m
Loading