-
Notifications
You must be signed in to change notification settings - Fork 14
57 lines (45 loc) · 1.53 KB
/
actions.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
# ref: https://github.com/actions/runner-images
name: build_and_test
# Controls when the action will run.
on: [push, pull_request, workflow_dispatch]
env:
PIP_BREAK_SYSTEM_PACKAGES: 1
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
unix:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest]
build_tool: [bazel, cmake]
name: "script ${{matrix.build_tool}}"
runs-on: ${{matrix.runs-on}}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Show env
run: env
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Setup bazel
if: matrix.build_tool == 'bazel'
uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Show bazel version
if: matrix.build_tool == 'bazel'
run: bazel --version
- name: Show cmake version
if: matrix.build_tool == 'cmake'
run: cmake --version
- name: Show platform info
run: python -m platform
- name: Install virtualenv
run: |
sudo apt-get install python3-pip -y
sudo pip3 install virtualenv
- name: Show nproc
run: echo nproc=$(nproc)
- name: Build and run tests
run: bash ./scripts/build_and_run_tests_${{matrix.build_tool}}.sh -j $(nproc)