Skip to content

Commit a0dff4b

Browse files
authored
Update to CI scripts use new images (#13)
* Update conan remote and debian/ubuntu images in CI - Sintef conan remote has changed and is updated in the readme - Bump VM images as well as containers that build packages - Running Ubuntu 16 images in github actions is no longer possible - A slight adjustment to compiler versions being used for gcc an msvc * Use specific SHA and URL for conan recipe in CI
1 parent b106a5e commit a0dff4b

File tree

4 files changed

+39
-19
lines changed

4 files changed

+39
-19
lines changed

.github/workflows/ci-conan-gcc.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,54 @@ env:
88
CONAN_PASSWORD_SINTEF: ${{ secrets.CONAN_PASSWORD }}
99
CONAN_LOGIN_USERNAME_SINTEF: ${{ secrets.CONAN_USER }}
1010
CONFIG_URL: https://github.com/sintef-ocean/conan-configs.git
11+
DEBIAN_FRONTEND: noninteractive
12+
TZ: Etc/UTC
1113

1214
jobs:
1315
conan-with-gcc:
1416
name: Conan
15-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-24.04
1618
strategy:
1719
fail-fast: false
1820
matrix:
1921
build_type: [Debug, Release]
2022
profile: [gcc]
21-
compiler_version: [10, 11, 12, 13]
23+
compiler_version: [11, 12, 13, 14]
2224
channel: ["${{ github.ref_type == 'tag' && 'stable' || 'testing' }}"]
25+
include:
26+
- linux: debian:latest
27+
-
28+
linux: debian:trixie
29+
compiler_version: 14
30+
-
31+
linux: ubuntu:24.04
32+
compiler_version: 13
33+
-
34+
linux: debian:bookworm
35+
compiler_version: 12
36+
-
37+
linux: ubuntu:22.04
38+
compiler_version: 11
2339
container:
24-
image: conanio/gcc${{ matrix.compiler_version }}-ubuntu16.04
40+
image: ${{ matrix.linux }}
2541
options: -u 0
2642
steps:
27-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
2844
- name: Install prerequisites
2945
run: |
30-
sudo apt-get update
31-
sudo apt-get install -y jq
32-
pip3 install --upgrade setuptools pip
33-
pip3 install --upgrade conan~=2.0
34-
- name: Configure Conan and package name
46+
apt-get update
47+
apt-get install -y jq pipx build-essential cmake git
48+
pipx install conan
49+
echo "/github/home/.local/bin" >> $GITHUB_PATH
50+
- name: Conan configs
3551
run: |
3652
conan remote add sintef ${{ env.CONAN_UPLOAD }}
3753
echo "pkg_name=$(conan inspect -f json . | jq .name -r)" >> $GITHUB_ENV
38-
- name: Conan create
39-
run: |
4054
git config --global --add safe.directory '*'
4155
conan config install ${{ env.CONFIG_URL }} --type git -sf conan2.0
4256
conan config install ${{ env.CONFIG_URL }} --type git -sf profiles -tf profiles
57+
- name: Conan create
58+
run: |
4359
conan create -s build_type=${{ matrix.build_type }} \
4460
-s compiler.version=${{ matrix.compiler_version }} \
4561
-pr:b=${{ matrix.profile }} -pr:h=${{ matrix.profile }} \

.github/workflows/ci-conan-msvc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ env:
1212
jobs:
1313
conan-with-msvc:
1414
name: Conan
15-
runs-on: windows-2022
15+
runs-on: windows-2025
1616
strategy:
1717
fail-fast: false
1818
matrix:
1919
build_type: [Debug, Release]
2020
profile: [msvc17]
21-
compiler_version: [192, 193]
21+
compiler_version: [192, 194]
2222
channel: ["${{ github.ref_type == 'tag' && 'stable' || 'testing' }}"]
2323
steps:
2424
- uses: actions/checkout@v4

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ for CPPFMU that you can use in your code, but you still need to compile
5656
`fmi_functions.cpp`. The package can be created with `conan create . --user sintef
5757
--channel stable`. The recipe and some precompiled binaries are available on Sintef
5858
Ocean's public artifactory], which can be added with `conan remote add sintef-public
59-
https://artifactory.smd.sintef.no/artifactory/api/conan/conan-local`. Note that when using
60-
the conan recipe, FMI 1 or 2 is added as a dependency, so you do not need to fetch them
61-
yourself. To use CPPFMU with conan, add the following lines to your `conanfile.py` and
62-
`CMakeLists.txt`:
59+
https://package.smd.sintef.no`. Note that when using the conan recipe, FMI 1 or 2 is added
60+
as a dependency, so you do not need to fetch them yourself. To use CPPFMU with conan, add
61+
the following lines to your `conanfile.py` and `CMakeLists.txt`:
6362

6463
`conanfile.py`:
6564
```python

conanfile.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from os import path
1+
from os import path, environ
22
from conan import ConanFile
33
from conan.errors import ConanInvalidConfiguration
44
from conan.tools.build import check_min_cppstd
@@ -44,7 +44,12 @@ def _compilers_minimum_version(self):
4444
def export(self):
4545
copy(self, "version.txt", self.recipe_folder, self.export_folder)
4646
git = Git(self, self.recipe_folder)
47-
scm_url, scm_commit = git.get_url_and_commit()
47+
if environ.get("CI") == "true":
48+
scm_commit = environ.get("GITHUB_SHA")
49+
scm_url = f"{environ.get('GITHUB_SERVER_URL')}/{environ.get('GITHUB_REPOSITORY')}"
50+
else:
51+
scm_url, scm_commit = git.get_url_and_commit()
52+
4853
update_conandata(self, {"sources": {"commit": scm_commit, "url": scm_url}})
4954

5055
def set_version(self):

0 commit comments

Comments
 (0)