-
Notifications
You must be signed in to change notification settings - Fork 137
82 lines (71 loc) · 2.46 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
name: "Lint"
on:
workflow_call:
permissions:
contents: read
pull-requests: read
jobs:
ts-lint:
# TODO(JayF): Determine what nodejs versions we target, and setup matrix-based testing similar to what we do for go
name: Lint TypeScript
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.12.0
cache: yarn
cache-dependency-path: ./internal/lookout/ui/yarn.lock
- name: Install Dependencies
working-directory: ./internal/lookout/ui
run: |
yarn install --frozen-lockfile
- name: Generating TypeScript lint results as summary
working-directory: ./internal/lookout/ui
run: |
yarn lint &> lint_results.txt || true
lint_results=$(cat lint_results.txt)
echo -e "## 🪧 Typescript Lint Results\n" >> $GITHUB_STEP_SUMMARY
if [[ $lint_results =~ "problem" ]]; then
echo -e "### List of Lint Issues \n" >> $GITHUB_STEP_SUMMARY
echo -e "${lint_results}" >> $GITHUB_STEP_SUMMARY
echo -e "${lint_results}"
exit 1
else
echo -e "### No Lint issues found.\n" >> $GITHUB_STEP_SUMMARY
echo -e "No Lint issues found."
exit 0
fi
go-lint:
name: Lint Go
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: ./.github/actions/setup-go-cache
with:
cache-prefix: go-lint
- name: Lint using golangci-lint
uses: golangci/golangci-lint-action@v4
with:
skip-pkg-cache: true
skip-build-cache: true
version: v1.54
only-new-issues: true
args: --timeout=10m --issues-exit-code=1 --sort-results ./...
- name: Generating Golang lint results as summary
if: ${{ always() }}
run: |
golangci-lint run > lint_results.txt || true
lint_results=$(cat lint_results.txt)
echo -e "## 🪧 Go Lint Results\n" >> $GITHUB_STEP_SUMMARY
if [ -z "$lint_results" ]; then
echo -e "### No Lint Issues found.\n" >> $GITHUB_STEP_SUMMARY
else
echo -e "### List of Lint Issues \n" >> $GITHUB_STEP_SUMMARY
echo -e "${lint_results}" >> $GITHUB_STEP_SUMMARY
fi
continue-on-error: true