2023-06-30 09:51:54 +00:00
|
|
|
name: Go
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
2023-12-28 16:25:19 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-02-23 18:47:01 +00:00
|
|
|
go-version: ["1.21", "1.22"]
|
|
|
|
name: Lint ${{ matrix.go-version == '1.22' && '(latest)' || '(old)' }}
|
2023-12-28 16:25:19 +00:00
|
|
|
|
2023-06-30 09:51:54 +00:00
|
|
|
steps:
|
2023-12-28 16:25:19 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-30 09:51:54 +00:00
|
|
|
|
|
|
|
- name: Set up Go
|
2023-12-28 16:25:19 +00:00
|
|
|
uses: actions/setup-go@v5
|
2023-06-30 09:51:54 +00:00
|
|
|
with:
|
2023-12-28 16:25:19 +00:00
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
cache: true
|
2023-06-30 09:51:54 +00:00
|
|
|
|
|
|
|
- name: Install libolm
|
|
|
|
run: sudo apt-get install libolm-dev libolm3
|
|
|
|
|
|
|
|
- name: Install goimports
|
|
|
|
run: |
|
|
|
|
go install golang.org/x/tools/cmd/goimports@latest
|
|
|
|
export PATH="$HOME/go/bin:$PATH"
|
|
|
|
|
|
|
|
- name: Install pre-commit
|
|
|
|
run: pip install pre-commit
|
|
|
|
|
|
|
|
- name: Lint
|
|
|
|
run: pre-commit run -a
|