This repository has been archived by the owner on Dec 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
73 lines (61 loc) · 2.23 KB
/
cmake.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
name: Build all
on:
workflow_dispatch:
push:
branches:
- master
env:
CONAN_REVISIONS_ENABLED: 1
CONAN_SCM_TO_CONANDATA: 1
CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }}
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_LOGIN_USERNAME }}
PROFILE_CONAN: conan-release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022, macos-11, macos-12 ]
os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12 ]
steps:
- name: Workaround preset name difference
if: runner.os == 'Windows'
shell: bash
run: echo "PROFILE_CONAN=conan-default" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
- name: Install Conan
shell: bash
run: |
pip install -r .github/workflows/requirements.txt
conan profile detect
#Set the default profile to use g++ 17 it it's not detected
sed -i.backup 's/compiler.cppstd=gnu14/compiler.cppstd=gnu17/g' ~/.conan2/profiles/default
conan remote add worldforge https://artifactory.ogenvik.org/artifactory/api/conan/conan
- name: Have Conan install packages
shell: bash
run: |
conan install tools/conan -pr default --build=missing --update
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
run: cmake --preset $PROFILE_CONAN . -DBUILD_TESTING=ON
- name: Build
shell: bash
run: cmake --build --preset $PROFILE_CONAN --parallel
- name: Test
shell: bash
run: ctest --preset $PROFILE_CONAN --output-on-failure --parallel
- name: Upload artifacts
shell: bash
run: |
if [[ x"$CONAN_PASSWORD" != "x" && x"$CONAN_LOGIN_USERNAME" != "x" ]]; then
echo "Creating and uploading Conan artifacts"
conan remote login worldforge $CONAN_LOGIN_USERNAME -p $CONAN_PASSWORD
conan create tools/conan -pr default
conan upload "*" -r worldforge -c
fi