Skip to content

Merge branch 'master' into feature/102-build-with-shared-false #199

Merge branch 'master' into feature/102-build-with-shared-false

Merge branch 'master' into feature/102-build-with-shared-false #199

Workflow file for this run

name: CI
# This workflow is triggered on pushes to the repository.
on: [push, workflow_dispatch]
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]
compiler_version: [9]
option_proxyfmu: ['proxyfmu=True', 'proxyfmu=False']
steps:
- uses: actions/checkout@v4
- name: Generate Dockerfile
run: |
mkdir /tmp/osp-builder-docker
cat <<'EOF' >/tmp/osp-builder-docker/Dockerfile
FROM conanio/gcc${{ matrix.compiler_version }}-ubuntu16.04
COPY entrypoint.sh /
ENTRYPOINT /entrypoint.sh
EOF
- name: Generate entrypoint.sh
run: |
cat <<'EOF' >/tmp/osp-builder-docker/entrypoint.sh
#!/bin/bash -v
set -eu
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
cd /mnt/source
conan install . -s build_type=${{ matrix.build_type }} -o "libcosim/*:${{ matrix.option_proxyfmu }}" --build=missing
cmake -S . -B build/${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build/${{ matrix.build_type }}
cmake --build build/${{ matrix.build_type }} --target install
EOF
chmod 0777 /tmp/osp-builder-docker/entrypoint.sh
- name: Build Docker image
run: docker build -t osp-builder /tmp/osp-builder-docker/
- name: Build cosim
run: |
chmod 0777 $(pwd) # because commands in conanio containers run as an unprivileged user
mkdir -m 0777 build
docker run --rm -v $(pwd):/mnt/source osp-builder
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: cosim-${{ runner.os }}-${{ matrix.build_type }}-${{ matrix.compiler_version }}-${{ matrix.option_proxyfmu }}
path: build/${{ matrix.build_type }}/dist
windows:
name: Windows
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019]
build_type: [Debug, Release]
option_proxyfmu: ['proxyfmu=True', 'proxyfmu=False']
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
run: |
pip3 install --upgrade setuptools pip
pip3 install conan
- name: Configure Conan
run: |
conan profile detect
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
- name: Build
run: |
conan install . -s build_type=${{ matrix.build_type }} -o "libcosim/*:${{ matrix.option_proxyfmu }}" --build=missing
cmake -S . -B build "-DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW
cmake --build build --config ${{ matrix.build_type }}
cmake --build build --config ${{ matrix.build_type }} --target install
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: cosim-${{ runner.os }}-${{ matrix.build_type }}-${{ matrix.option_proxyfmu }}
path: build/dist