-
Notifications
You must be signed in to change notification settings - Fork 40
95 lines (93 loc) · 2.53 KB
/
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
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
name: ci
on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.21"]
name: Lint with Go ${{ matrix.go }}
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Install dependencies
run: make install/dev
# It duplicates running linter from pre-commit
# but as revive is set up differently, we want
# to make sure that `make lint` also works.
- name: Run lint from Makefile
run: make lint
- uses: pre-commit/action@v2.0.3
- name: pre-commit
run: pre-commit run --files $(git diff-tree --no-commit-id --name-only -r HEAD)
build-and-test:
# Don't use make here as this job needs to be cross-platform.
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
os: [ubuntu-latest, windows-latest]
name: Build and test with Go ${{ matrix.go }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Setup Node version
uses: actions/setup-node@v1
with:
node-version: 18
- name: Build
run: |
go build -o runme main.go
./runme --version
- name: Test
run: SHELL=/bin/bash TZ=UTC go test ./...
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Test
run: |
Set-Timezone -Id "UTC" -PassThru
go test ./...
if: ${{ matrix.os == 'windows-latest' }}
build-and-robustness-test:
name: Test parser against vast amount of READMEs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node version
uses: actions/setup-node@v1
with:
node-version: 18
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: ">=1.21"
- name: Install dependencies
run: make install/dev
- name: Build
run: |
go build -o runme main.go
./runme --version
- name: Run robustness test
run: make test/robustness
timeout-minutes: 5
- name: 🐛 Debug Build
uses: stateful/vscode-server-action@v1.1.0
if: failure()
with:
timeout: "300000"