-
Notifications
You must be signed in to change notification settings - Fork 26
111 lines (93 loc) · 2.5 KB
/
tests.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
110
111
name: Tests
on:
push:
branches:
- master
pull_request:
permissions:
contents: write
checks: write
pull-requests: read
jobs:
build-ui:
uses: ./.github/workflows/build-ui.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
typos:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: typos-action
uses: crate-ci/[email protected]
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
only-new-issues: true
version: latest
tests:
name: Tests
needs: build-ui
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
cache: true
check-latest: true
- uses: actions/setup-python@v5
with:
python-version: '3.12'
check-latest: true
cache: 'pip'
cache-dependency-path: 'scripts/requirements.txt'
- name: Add python dependencies
run: |
pip install -r scripts/requirements.txt
- name: Download UI file
uses: actions/download-artifact@v4
with:
name: ui
- name: Move UI file
run: mv index.html internal/webui/index.html
- name: Cache test binaries
uses: actions/cache@v4
with:
path: scripts/bins
key: test-bins-${{ hashFiles('scripts/binaries.csv') }}
enableCrossOsArchive: true
- name: Run tests
run: python scripts/tests.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload unit coverage
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: unit.profile
flags: unit
- name: Upload integration coverage
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: integration.profile
flags: integration
- name: Upload results
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.os }}-results
path: results/