Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Mark as deprecated. See https://github.com/worldforge/worldforge. #42

Mark as deprecated. See https://github.com/worldforge/worldforge.

Mark as deprecated. See https://github.com/worldforge/worldforge. #42

Workflow file for this run

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