-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (79 loc) · 2.36 KB
/
code-health-tools.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
name: 'Code Health Tools'
on:
push:
branches:
- main
paths:
- 'tools/**'
pull_request: {}
workflow_dispatch: {}
workflow_call: {}
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout CLI
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version-file: 'tools/cli/go.mod'
- name: Build CLI
working-directory: tools/cli
run: make build
unit-tests:
needs: build
env:
COVERAGE: coverage.out
UNIT_TAGS: unit
INTEGRATION_TAGS: integration
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version-file: 'tools/cli/go.mod'
- name: Run unit tests
working-directory: tools/cli
run: make unit-test
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
with:
sparse-checkout: |
.github
tools
- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version-file: 'tools/cli/go.mod'
cache: false # see https://github.com/golangci/golangci-lint-action/issues/807
- name: golangci-lint
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804
with:
version: v1.56.2
working-directory: tools/cli
- name: Checkout GitHub actions
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
with:
sparse-checkout: |
.github
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: Check workflow files
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
${{ steps.get_actionlint.outputs.executable }} -color
shell: bash