-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (92 loc) · 3.04 KB
/
tests.yaml
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
name: New changes validation
on:
push:
branches:
- 'main'
pull_request:
env:
WORK_PATH: /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/
jobs:
cache-V:
runs-on: ubuntu-latest
steps:
# Because of problems with `setup-v` action, when Vlang version is specified, and also because of V evolving continuously,
# and you need the latest commit of V most of the time, we always use the latest V version from the master branch
# and getting it from the cache on the start of a job is not possible (because you need to know a version of V to cache it).
# This step should be uncommented when Vlang will be stable and caching will be possible.
# - name: Check if V is cached
# id: check-v-cache
# uses: actions/cache/restore@v3
# with:
# path: ${{ env.WORK_PATH }}vlang/
# key: vlang-0.3.3-weekly.2023.08
- name: Install V
id: install-v
uses: vlang/[email protected]
with:
check-latest: true
- name: Set V_VERSION environment variable
run: echo "V_VERSION=$(v -v)" >> $GITHUB_ENV
- name: Cache Vlang
uses: actions/cache/save@v3
with:
path: ${{ env.WORK_PATH }}vlang/
key: vlang-${{ env.V_VERSION }}
simple-build:
needs: cache-V
runs-on: ubuntu-latest
strategy:
matrix:
trimming: [ null , -skip-unused ]
memory-management: [ null , -autofree ]
steps:
- name: Restore Vlang
uses: actions/cache/restore@v3
with:
path: ${{ env.WORK_PATH }}vlang/
key: vlang-${{ env.V_VERSION }}
fail-on-cache-miss: true
- name: Install V
uses: vlang/[email protected]
with:
check-latest: true
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v3
- name: ${{ matrix.trimming }} ${{ matrix.memory-management }} build
run: v -shared -prod ${{ matrix.trimming }} ${{ matrix.memory-management }} .
tests:
needs: simple-build
runs-on: ubuntu-latest
steps:
- name: Restore Vlang
uses: actions/cache/restore@v3
with:
path: ${{ env.WORK_PATH }}vlang/
key: vlang-${{ env.V_VERSION }}
fail-on-cache-miss: true
- name: Install V
uses: vlang/[email protected]
with:
check-latest: true
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v3
- name: Run tests
run: v test .
check-format:
needs: simple-build
runs-on: ubuntu-latest
steps:
- name: Restore Vlang
uses: actions/cache/restore@v3
with:
path: ${{ env.WORK_PATH }}vlang/
key: vlang-${{ env.V_VERSION }}
fail-on-cache-miss: true
- name: Install V
uses: vlang/[email protected]
with:
check-latest: true
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v3
- name: Run tests
run: v fmt -c .