-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (74 loc) · 2.23 KB
/
Copy pathlint.yml
File metadata and controls
85 lines (74 loc) · 2.23 KB
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
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
---
name: 🧹 Lint
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
name: 🧹 Lint (${{ matrix.task }})
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
strategy:
fail-fast: false
matrix:
task:
- go
- md
- yaml
steps:
- name: ⤵️ Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: 🚧 Setup Go
if: matrix.task == 'go'
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: true
- name: 🚧 Setup Node
if: matrix.task == 'md' || matrix.task == 'yaml'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
- name: 🚧 Setup Task
uses: go-task/setup-task@a00fbb05ce67b35648be3c78cbc9fd85354c757e # v2.2.0
- name: 📌 Load tool versions
if: matrix.task == 'go'
run: |
source .github/tool-versions.sh
echo "GOLANGCI_LINT_VERSION=$GOLANGCI_LINT_VERSION" >> "$GITHUB_ENV"
- name: 🔨 Install golangci-lint
if: matrix.task == 'go'
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
- name: ✔️ Run lint (${{ matrix.task }})
run: task lint:${{ matrix.task }}
check-lint:
if: always()
name: 🧹 Check Lint
needs: lint
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: ✅ OK
if: ${{ !(contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }}
run: exit 0
- name: 🛑 Failure
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1