-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (70 loc) · 2.39 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
name: tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
formatting:
name: Check source code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install the Findutils and ClangFormat packages
run: |
sudo apt-get update
sudo apt-get install --yes findutils clang-format
- name: Check that all source code files are correctly formatted
run: |
find include/ test/ -iname *.hpp -or -iname *.cpp | xargs clang-format --style=file -i
CHANGES=$(git diff --name-only)
if ! [ -z "$CHANGES" ]; then
echo "Some source code files are incorrectly formatted. To format all source code files, run:"
echo " find include/ test/ -iname *.hpp -or -iname *.cpp | xargs clang-format --style=file -i"
exit 1;
fi
bazel:
name: Build and test with Bazel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install the C++ and Curl packages
run: |
sudo apt-get update
sudo apt-get install --yes g++ curl
- name: Install the Bazel package
run: |
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
sudo apt-get update
sudo apt-get install --yes bazel
- name: Build the Physical Quantities library tests
run: bazel build //:all
- name: Run the Physical Quantities library tests
run: bazel test //:all
cmake:
name: Build and test with CMake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Install the C++ and CMake packages
run: |
sudo apt-get update
sudo apt-get install --yes g++ cmake
- name: Configure the Physical Quantities library
run: |
mkdir --parents build
cd build
cmake .. -D PHYSICAL_QUANTITIES_PHQ_TEST=ON
- name: Build the Physical Quantities library tests
run: |
cd build
make --jobs=16
- name: Run the Physical Quantities library tests
run: |
cd build
make test
- name: Install the Physical Quantities library
run: |
cd build
sudo make install