-
Notifications
You must be signed in to change notification settings - Fork 10
111 lines (105 loc) · 3.83 KB
/
ci-conan.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
name: CI with Conan
# 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']
option_shared: ['shared=True', 'shared=False']
timeout-minutes: 35
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
ENV CONAN_LOGIN_USERNAME_OSP=${{ secrets.osp_artifactory_usr }}
ENV CONAN_PASSWORD_OSP=${{ secrets.osp_artifactory_pwd }}
ENV LIBCOSIM_RUN_TESTS_ON_CONAN_BUILD=1
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
cd /mnt/source
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
REFNAME="${GITHUB_REF#refs/*/}"
VERSION="v$(<version.txt)"
if [[ $GITHUB_REF == refs/tags/* ]] && [[ $REFNAME == $VERSION ]]; then CHANNEL="stable"
elif [[ $REFNAME == master ]]; then CHANNEL="testing"
else
SHORT_REFNAME="${REFNAME:0:40}"
CHANNEL="testing-${SHORT_REFNAME//\//_}"
fi
conan create \
--settings="build_type=${{ matrix.build_type }}" \
--options="${{ matrix.option_proxyfmu }}" \
--options="${{ matrix.option_shared }}" \
--build=missing \
--user=osp \
--channel="${CHANNEL}" \
.
conan upload --confirm --remote=osp '*'
EOF
chmod 0755 /tmp/osp-builder-docker/entrypoint.sh
- name: Build Docker image
run: docker build -t osp-builder /tmp/osp-builder-docker/
- name: Build cosim
run: |
docker run --rm --env GITHUB_REF="$GITHUB_REF" -v $(pwd):/mnt/source:ro osp-builder
windows:
name: Windows
runs-on: ${{ matrix.os }}
env:
CONAN_LOGIN_USERNAME_OSP: ${{ secrets.osp_artifactory_usr }}
CONAN_PASSWORD_OSP: ${{ secrets.osp_artifactory_pwd }}
LIBCOSIM_RUN_TESTS_ON_CONAN_BUILD: 1
strategy:
fail-fast: false
matrix:
os: [windows-2019]
build_type: [Debug, Release]
option_proxyfmu: ['proxyfmu=True', 'proxyfmu=False']
option_shared: ['shared=True', 'shared=False']
timeout-minutes: 120
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: Conan create
shell: bash
run: |
REFNAME="${GITHUB_REF#refs/*/}"
VERSION="v$(<version.txt)"
if [[ $GITHUB_REF == refs/tags/* ]] && [[ $REFNAME == $VERSION ]]; then CHANNEL="stable"
elif [[ $REFNAME == master ]]; then CHANNEL="testing"
else
SHORT_REFNAME="${REFNAME:0:40}"
CHANNEL="testing-${SHORT_REFNAME//\//_}"
fi
conan create \
--settings="build_type=${{ matrix.build_type }}" \
--options="${{ matrix.option_proxyfmu }}" \
--options="${{ matrix.option_shared }}" \
--build=missing \
--user=osp \
--channel="${CHANNEL}" \
.
- name: Conan upload
run: conan upload --confirm --remote=osp '*'