-
Notifications
You must be signed in to change notification settings - Fork 16
78 lines (68 loc) · 1.75 KB
/
analyzer_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
name: Analyzer CI
on:
push:
paths-ignore:
- '.github/**'
- '!**/analyzer_tests.yml'
- '!**/version_test.vv'
- 'editors/code/**'
- '**/*.md'
pull_request:
paths-ignore:
- '.github/**'
- '!**/analyzer_tests.yml'
- '!**/version_test.vv'
- 'editors/code/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
include:
- os: macos-latest
cc: clang
- os: ubuntu-20.04
cc: gcc
- os: windows-latest
cc: gcc
fail-fast: false
runs-on: ${{ matrix.os }}
env:
VFLAGS: -cg -cc ${{ matrix.cc }}
steps:
- name: Install V
id: install-v
uses: vlang/[email protected]
with:
check-latest: true
- name: Checkout v-analyzer
uses: actions/checkout@v4
with:
submodules: true
- name: Run tests
run: v test .
- name: Install v-analyzer
if: runner.os != 'Windows'
run: |
# Build and install v-analyzer at the head ref of the submitted changes.
v run build.vsh
sudo mv ./bin/v-analyzer /usr/local/bin/v-analyzer
v-analyzer --version
- name: Verify version
# TODO: include Windows
if: runner.os != 'Windows'
run: v .github/workflows/version_test.vv
- name: Verify formatting
shell: bash
run: |
set +e
v fmt -c .
exit_code=$?
# Don't fail on internal errors.
if [[ $exit_code -ne 0 && $exit_code -ne 5 ]]; then
v fmt -diff .
exit 1
fi