-
Notifications
You must be signed in to change notification settings - Fork 1
27 lines (27 loc) · 850 Bytes
/
ci.yml
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
name: CI
on:
push:
branches:
- master
pull_request: ~
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Go version from .tool-versions
run: echo "GO_VERSION=$(cat .tool-versions | grep -oP 'golang \K((\w+.)+\w+)')" >> $GITHUB_ENV
- name: Get golangci-lint version from .tool-versions
run: echo "GOLANGCI_LINT_VERSION=$(cat .tool-versions | grep -oP 'golangci-lint \K((\w+.)+\w+)')" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: '${{ env.GO_VERSION }}'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: 'v${{ env.GOLANGCI_LINT_VERSION }}'
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pre-commit/[email protected]