-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.82 KB
/
Copy pathcpp.yml
File metadata and controls
50 lines (42 loc) · 1.82 KB
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
name: C++ CI
on:
push
jobs:
test:
name: Tests in ${{ matrix.build_type }} with ${{ matrix.compilerSetter }}
runs-on: ubuntu-20.04
container: ubuntu:21.10
env:
DEBIAN_FRONTEND: noninteractive
CI_RUN: 1
NO_DEBUG: 1
strategy:
matrix:
build_type: [Release, SanitizedDebug, RelWithDebInfo]
compilerSetter: [CC=gcc CXX=g++, CC=clang CXX='clang++ -stdlib=libc++']
steps:
- name: dependencies
run: |
apt-get update
apt-get install -y gpg wget
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
apt-get update
apt-get install -y git build-essential binutils gcc clang cmake valgrind libc++-dev libc++abi-dev ninja-build curl zip unzip tar pkg-config libunwind-13-dev kitware-archive-keyring
cd ..
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
cd $GITHUB_WORKSPACE
# see https://github.com/actions/checkout/issues/760
- name: git-workaround
run: |
export REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')
git config --global --add safe.directory /__w/${REPOSITORY_NAME}/${REPOSITORY_NAME}
- uses: actions/checkout@v2
- name: Build main
run: ${{ matrix.compilerSetter }} ci-extra/build.sh ${{ matrix.build_type }}
- name: Test main
run: ci-extra/test.sh ${{ matrix.build_type }}
- if: ${{ matrix.build_type == 'RelWithDebInfo' }}
name: Test main with valgrind
run: ci-extra/test-valgrind.sh