-
Notifications
You must be signed in to change notification settings - Fork 12
94 lines (90 loc) · 2.59 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
on:
push:
branches:
- '**'
name: tests
jobs:
clippy:
name: Actions - clippy
runs-on: self-hosted
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
components: clippy
profile: minimal
override: true
- run: cargo fetch --verbose
- run: cargo clippy --all --all-targets -- -D warnings
rustfmt:
name: Actions - rustfmt
runs-on: self-hosted
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
components: rustfmt
profile: minimal
override: true
- run: cargo fmt -- --check
unit-test:
name: Actions - unit test
runs-on: self-hosted
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
profile: minimal
- run: cargo fetch --verbose
- run: cargo build
- run: cargo test --verbose --all
env:
RUST_BACKTRACE: 1
integration-test:
name: Actions - integration test
runs-on: self-hosted
steps:
- name: Upgrade docker compose to use v2
run: sudo curl -L "https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.73.0
profile: minimal
override: true
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '18.16.1'
cache: 'yarn'
cache-dependency-path: integration_tests/yarn.lock
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: 1.20
cache: false
- name: Lint
run: cd integration_tests && yarn --ignore-engines && yarn lint
# - name: Build images
# run: |
# cd integration_tests
# cat package.json | grep -e "build-[a-z]*-image\"" | awk -F: '{print $1}' | tr -d ' ",{}' | xargs -I % -P 3 yarn %
- name: Build images
run: |
cd integration_tests
yarn build-images
- run: make compile
- name: Run tests
run: |
cd integration_tests
yarn vitest ./src --run --shard 1/2 --bail 1
yarn vitest ./src --run --shard 2/2 --bail 1