-
Notifications
You must be signed in to change notification settings - Fork 2
130 lines (110 loc) · 3.56 KB
/
pytest.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: pytest
on:
push:
branches:
- main
- develop
pull_request:
jobs:
pytest:
strategy:
fail-fast: false
matrix:
include:
# mobc pytest matrix(splitted because super-slow)
- c2a_user: mobc
test_dir: src_core/applications
- c2a_user: mobc
test_dir: src_core/system/event_manager/test_event_handler.py
- c2a_user: mobc
test_dir: src_core/system/event_manager/test_event_logger.py
- c2a_user: mobc
test_dir: src_core/system/task_manager
- c2a_user: mobc
test_dir: src_core/system/watchdog_timer
- c2a_user: mobc
test_dir: src_core/system/mode_manager
- c2a_user: mobc
test_dir: src_core/system/time_manager
- c2a_user: mobc
test_dir: src_core/tlm_cmd
# 2nd_obc_user
- c2a_user: subobc
test_dir: .
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
submodules: recursive
- name: install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-multilib g++-multilib
- name: setup c2a-core
run: ./setup.sh
- uses: pnpm/[email protected]
with:
package_json_file: examples/${{ matrix.c2a_user }}/package.json
- uses: actions/[email protected]
with:
cache: pnpm
cache-dependency-path: examples/${{ matrix.c2a_user }}/pnpm-lock.yaml
- name: Cache C2A devtools
id: cache-c2a-devtools
uses: actions/[email protected]
with:
path: |
./examples/mobc/tools/bin
./examples/mobc/tools/.crates.toml
./examples/mobc/tools/.crates2.json
key: ${{ matrix.c2a_user }}-${{ runner.os }}-tools-${{ hashFiles('${{ matrix.c2a_user }}/tools/install.sh', '${{ matrix.c2a_user }}/tools/package.json') }}
- name: Get Rust toolchain
id: toolchain
run: |
awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain.toml >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ steps.toolchain.outputs.toolchain }}
targets: i686-unknown-linux-gnu
components: clippy, rustfmt
- name: cache Rust dependencies
uses: Swatinem/[email protected]
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: sksat/[email protected]
- name: install pytest deps
working-directory: examples/${{ matrix.c2a_user }}/src/src_user/test
run: |
rye sync
- name: the heaviest objects in universe
working-directory: ./examples/mobc
run: |
pnpm install --frozen-lockfile
- name: build mobc C2A
if: matrix.c2a_user == 'subobc'
working-directory: ./examples/mobc
run: |
cargo build --locked
- name: build C2A
working-directory: ./examples/${{ matrix.c2a_user }}
run: |
cargo build --locked
- name: run mobc C2A
if: matrix.c2a_user == 'mobc'
working-directory: ./examples/mobc
run: |
pnpm run devtools:sils &
sleep 3
- name: run C2A (mobc & subobc)
if: matrix.c2a_user == 'subobc'
working-directory: ./examples/mobc
run: |
npm run devtools:sils-subobc &
sleep 3
- name: run pytest
working-directory: ./examples/${{ matrix.c2a_user }}/src/src_user/test
run: |
rye run pytest -m sils -v ./${{ matrix.test_dir }}