-
-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (94 loc) · 2.8 KB
/
ccpp.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Backend CI
on:
push:
branches: [ main ]
paths:
- 'backend/**'
- 'api/schema/**'
- '.github/actions/**'
- '.github/workflows/ccpp.yml'
pull_request:
branches: [ main ]
paths:
- 'backend/**'
- 'api/schema/**'
- '.github/actions/**'
- '.github/workflows/ccpp.yml'
env:
CONAN_REMOTE: user-management
jobs:
ubuntu:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: cache pip data
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
- name: setup conan
uses: ./.github/actions/setup-conan
- name: install cmake
uses: lukka/get-cmake@latest
- name: install lcov
run: |
sudo apt-get install lcov
- name: conan install
working-directory: backend
run: |
conan lock create conanfile.py --version=0.0.0 -pr=debug --lockfile=conan.lock --lockfile-out=build/conan.lock
conan install conanfile.py --lockfile=build/conan.lock -if build
- name: configure
working-directory: backend
run: |
cmake --preset debug -B build -DBUILD_TESTS=ON -DCOVERAGE=ON
- name: build
working-directory: backend
run: cmake --build build/ --target user_tests
- name: coverage
working-directory: backend/build
run: |
make coverage
- uses: codecov/codecov-action@v3
with:
file: backend/build/coverage.info
name: cpp-backend-unit-tests
fail_ci_if_error: true
macos:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: cache pip data
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
- name: setup conan
uses: ./.github/actions/setup-conan
- name: loggin to private remote
run: conan user -p ${{ secrets.JFROG_RTFACT_PASSWORD }} -r $CONAN_REMOTE [email protected]
- name: install cmake
uses: lukka/get-cmake@latest
- name: conan install
working-directory: backend
run: |
conan lock create conanfile.py --version=0.0.0 --lockfile=conan.lock --lockfile-out=build/conan.lock
conan install conanfile.py --lockfile=build/conan.lock -if build
- name: configure
working-directory: backend
run: |
cmake --preset release -B build -DBUILD_TESTS=ON
- name: build
working-directory: backend
run: cmake --build build/
- name: test
working-directory: backend/build
run: ./test/user_tests