Skip to content

Commit 3da4729

Browse files
Update CI scripts (deal with deprecated OS versions) (#304)
* Use ubuntu 22.04 instead of ubuntu 20.04 * Temporary disable old compilers * Experiment with reusable workflow * Update FreeBSD image families in Cirrus CI configuration
1 parent cffccc4 commit 3da4729

File tree

4 files changed

+75
-54
lines changed

4 files changed

+75
-54
lines changed

.cirrus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ task:
22
name: FreeBSD
33
freebsd_instance:
44
matrix:
5-
- image_family: freebsd-13-3
6-
- image_family: freebsd-14-0
5+
- image_family: freebsd-13-5
6+
- image_family: freebsd-14-3
77
- image_family: freebsd-15-0-snap
88
matrix:
99
- BUILD_TYPE: Release

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Reusable build workflow (hack to be able to skip container image)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
image:
7+
description: Image to use for the job. If image is 'null' it will execute directly on the runner.
8+
type: string
9+
required: false
10+
default: null
11+
os:
12+
description: OS to use for the job.
13+
type: string
14+
required: false
15+
default: ubuntu--latest
16+
cxx:
17+
description: CXX to use for the job.
18+
type: string
19+
required: false
20+
default: null
21+
generator:
22+
description: Cmake generator to use for the job.
23+
type: string
24+
required: false
25+
default: null
26+
jobs:
27+
build:
28+
runs-on: ${{ inputs.os }}
29+
container:
30+
image: ${{ inputs.image }}
31+
options: --user root
32+
env:
33+
CXX: ${{ inputs.cxx }}
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v1 # https://github.com/actions/checkout/issues/1590
38+
with:
39+
fetch-depth: 0
40+
41+
- name: Build
42+
run: |
43+
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DPLOG_BUILD_TESTS=ON ${{ inputs.generator }} .
44+
cmake --build build --parallel
45+
46+
- name: Test
47+
run: cd build && ctest -V

.github/workflows/ci.yml

Lines changed: 17 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -35,61 +35,27 @@ jobs:
3535
fail-fast: true
3636
matrix:
3737
include: [
38-
# You can access the following values via ${{ matrix.??? }}
39-
#
40-
# pkgs : apt-get package names separated by space
41-
# cxx : C++ compiler executable
42-
# os : GitHub Actions YAML workflow label. See https://github.com/actions/virtual-environments#available-environments
43-
4438
# linux: gcc
45-
{ os: ubuntu-24.04, cxx: g++-14, pkgs: '' }, # (default on Noble 24.04)
46-
{ os: ubuntu-22.04, cxx: g++-11, pkgs: '' }, # (default on Jammy 22.04)
47-
{ os: ubuntu-22.04, cxx: g++-9, pkgs: '' }, # (default on Focal 20.04)
48-
{ os: ubuntu-20.04, cxx: g++-7, pkgs: 'g++-7' }, # (default on Bionic 18.04)
49-
{ os: ubuntu-20.04, cxx: g++-5, pkgs: 'g++-5', repo: 'xenial' }, # (default on Xenial 16.04)
50-
{ os: ubuntu-20.04, cxx: g++-4.8, pkgs: 'g++-4.8', repo: 'trusty' }, # (default on Trusty 14.04)
39+
{ os: ubuntu-24.04, cxx: g++-14 }, # (default on Noble 24.04)
40+
{ os: ubuntu-22.04, cxx: g++-11 }, # (default on Jammy 22.04)
41+
{ os: ubuntu-22.04, cxx: g++-9 }, # (default on Focal 20.04)
42+
{ os: ubuntu-latest, cxx: g++-7, image: conanio/gcc7 }, # (default on Focal 20.04)
43+
{ os: ubuntu-latest, cxx: g++-5, image: conanio/gcc5 }, # (default on Xenial 16.04)
44+
{ os: ubuntu-latest, cxx: g++-4.8, image: conanio/gcc48 }, # (default on Trusty 14.04)
5145
# linux: clang
52-
{ os: ubuntu-22.04, cxx: clang++-14, pkgs: '' },
53-
{ os: ubuntu-20.04, cxx: clang++-10, pkgs: '' },
54-
{ os: ubuntu-20.04, cxx: clang++-6.0, pkgs: 'clang-6.0' },
46+
{ os: ubuntu-24.04, cxx: clang++-18 },
47+
{ os: ubuntu-latest, cxx: clang++-6.0, image: conanio/clang60 },
5548
# windows: msvc
56-
{ os: windows-2019, cxx: 'vs2019' },
57-
{ os: windows-2022, cxx: 'vs2022' },
49+
# unfortunately, Visual Studio 2019 is not available on github-hosted runners anymore
50+
{ os: windows-2022, cxx: vs2022-x86, generator: '-G "Visual Studio 17 2022" -A Win32' },
51+
{ os: windows-2022, cxx: vs2022-x64, generator: '-G "Visual Studio 17 2022" -A x64' },
5852
# macos: clang
5953
{ os: macos-13, cxx: 'clang++' }
6054
]
6155

62-
runs-on: ${{ matrix.os }}
63-
64-
env:
65-
CXX: ${{ matrix.cxx }}
66-
67-
steps:
68-
- name: checkout
69-
uses: actions/checkout@v3
70-
with:
71-
fetch-depth: 0
72-
73-
# workaround for broken clang on ubuntu runner until https://github.com/actions/runner-images/issues/8659 get fixed
74-
- uses: mjp41/workaround8649@c8550b715ccdc17f89c8d5c28d7a48eeff9c94a8
75-
with:
76-
os: ${{ matrix.os }}
77-
78-
- name: apt/sources.list.d
79-
if: ${{ matrix.repo != '' }}
80-
run: |
81-
echo "deb http://archive.ubuntu.com/ubuntu ${{ matrix.repo }} main" | sudo tee /etc/apt/sources.list.d/${{ matrix.repo }}.list
82-
83-
- name: apt-get install
84-
if: ${{ matrix.pkgs != '' }}
85-
run: |
86-
sudo apt-get update
87-
sudo apt-get install ${{ matrix.pkgs }}
88-
89-
- name: build
90-
run: |
91-
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DPLOG_BUILD_TESTS=1 .
92-
cmake --build build --parallel
93-
94-
- name: test
95-
run: cd build && ctest -V
56+
uses: ./.github/workflows/build.yml
57+
with:
58+
image: ${{ matrix.image }}
59+
os: ${{ matrix.os }}
60+
cxx: ${{ matrix.cxx }}
61+
generator: ${{ matrix.generator }}

samples/FreeRTOS/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
2+
if(POLICY CMP0135) # Controls timestamps of the extracted contents (DOWNLOAD_EXTRACT_TIMESTAMP)
3+
cmake_policy(SET CMP0135 NEW)
4+
endif()
5+
6+
# This sample requires GCC 6.0 or later
7+
if(NOT CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
8+
return()
9+
endif()
10+
211
include(FetchContent)
312

413
# Select FreeRTOS port
@@ -15,7 +24,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
1524
freertos_kernel
1625
URL https://github.com/FreeRTOS/FreeRTOS-Kernel/archive/refs/tags/V11.1.0.tar.gz
1726
URL_HASH SHA256=0e21928b3bcc4f9bcaf7333fb1c8c0299d97e2ec9e13e3faa2c5a7ac8a3bc573
18-
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
1927
)
2028

2129
FetchContent_MakeAvailable(freertos_kernel)

0 commit comments

Comments
 (0)