-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (34 loc) · 1.08 KB
/
test-snippets.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
name: Test snippets
on:
pull_request:
workflow_dispatch:
jobs:
test-snippets:
runs-on: ubuntu-latest
steps:
- name: Checkout parent project
uses: actions/checkout@v2
with:
repository: ivan100sic/snippets-cpp
path: parent
- name: Checkout this repo
uses: actions/checkout@v2
with:
path: main
- name: Add Toolchain APT repository
run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- name: Install g++-11
run: sudo apt-get install -y g++-11
- name: Prepare CMake build folder
working-directory: ./parent
run: mkdir build
- name: Generate CMake build files
working-directory: ./parent/build
run: cmake .. -D CMAKE_CXX_COMPILER=g++-11
- name: Build parent
working-directory: ./parent/build
run: cmake --build .
- name: Run tests
run: ./parent/build/test --compiler-path=g++-11 --sources_folder=./main
- name: Verify snippet syntax
run: ./parent/build/generate --sources_folder=./main --cpp-standard=20 > /dev/null