-
Notifications
You must be signed in to change notification settings - Fork 642
109 lines (102 loc) · 3.37 KB
/
lint.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: lint
on:
push:
branches:
- main
- 'release/**'
pull_request:
env:
GO_VERSION: 1.24
GOTOOLCHAIN: local
GO_INSTALL_DESTINATION: /opt
GOOS: linux
jobs:
go_current:
timeout-minutes: 5
name: "go stable"
runs-on: ubuntu-24.04
steps:
# First, setup: clone, install go (with cache), install dev tools (with cache)
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 100
- name: Environment setup
run: |
echo "GO_VERSION=$(make install-go-resolve-version)" >> "$GITHUB_ENV"
echo "PATH=$GO_INSTALL_DESTINATION/go/bin:$HOME/go/bin:$PATH" >> "$GITHUB_ENV"
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
id: cache-go
with:
path: /opt/go
key: golang-${{ env.GOOS }}-${{ env.GO_VERSION }}
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
id: cache-go-dev
with:
path: ~/go/bin
key: golang-dev-${{ env.GOOS }}-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
- if: ${{ steps.cache-go.outputs.cache-hit != 'true' }}
name: Install go
continue-on-error: false
run: make install-go
- if: ${{ steps.cache-go-dev.outputs.cache-hit != 'true' }}
name: Install dev tools
continue-on-error: false
run: make install-dev-tools
- name: imports
run: make lint-imports
- name: mod
run: make lint-mod
- name: go
run: make lint-go-all
- name: go
# This is duplicating some of the work done in projects-check (which uses an old / buggy version
# of go-licenses, and also only test for linux).
run: make lint-licenses-all
go_canary:
timeout-minutes: 5
name: "go canary"
runs-on: ubuntu-24.04
env:
GO_VERSION: canary
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: Environment setup
run: |
echo "GO_VERSION=$(make install-go-resolve-version)" >> "$GITHUB_ENV"
echo "PATH=$GO_INSTALL_DESTINATION/go/bin:$HOME/go/bin:$PATH" >> "$GITHUB_ENV"
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
id: cache-go
with:
path: /opt/go
key: golang-${{ env.GOOS }}-${{ env.GO_VERSION }}
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
id: cache-go-dev
with:
path: ~/go/bin
key: golang-dev-${{ env.GOOS }}-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}
- if: ${{ steps.cache-go.outputs.cache-hit != 'true' }}
name: Install go
run: make install-go
- if: ${{ steps.cache-go-dev.outputs.cache-hit != 'true' }}
name: Install dev tools
run: make install-dev-tools
- name: imports
run: make lint-imports
- name: mod
run: make lint-mod
- name: go
run: make lint-go-all
other:
timeout-minutes: 5
name: "yaml | shell"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: make lint-yaml
run: make lint-yaml
- name: make lint-shell
run: make lint-shell