-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.54 KB
/
test.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
name: Tests
on:
push:
branches:
- main
pull_request:
env:
# home directory of user in obcpp docker image
HOME_DIR: /home/tuas
# https://stackoverflow.com/a/71158878
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# this is needed for CMake to find where ArenaSDK is
# installed to. See the Dockerfile for what is installed
# to this path
ARENA_EXTRACTED_PATH: "/arena-tmp/ArenaSDK_Linux_x64"
jobs:
test:
name: C++ Tests
runs-on: ubuntu-latest
container:
image: ghcr.io/tritonuas/obcpp:x86
env:
GITHUB_ACTIONS: "true"
steps:
- name: Create directory
run: mkdir -p "$HOME_DIR/obcpp"
- name: Print branch name
run: echo "$BRANCH_NAME"
- name: Clone Repo
run: git clone --branch $BRANCH_NAME https://oauth2:${{secrets.GITHUB_TOKEN}}@github.com/tritonuas/obcpp.git $HOME_DIR/obcpp
- name: cat arena.cmake
run: cat "$HOME_DIR/obcpp/deps/arena-sdk/arena.cmake"
- name: Pull Submodules
run: cd "$HOME_DIR/obcpp" && git rm protos && git submodule add https://oauth2:${{secrets.GITHUB_TOKEN}}@github.com/tritonuas/protos.git && cd protos && git pull
- name: Set up CMake
# uses ${CMAKE_PREFIX_PATH} set in Dockerfile env
run: cd "$HOME_DIR/obcpp" && rm -rf build && mkdir build && cd build && sudo ARENA_EXTRACTED_PATH="/arena-tmp/ArenaSDK_Linux_x64" cmake -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" -DCMAKE_JOB_POOLS="j=4" ..
- name: Run Tests
run: cd "$HOME_DIR/obcpp/build" && sudo ninja test