Skip to content

ensure that we have an import_std configuration in the test-set #370

ensure that we have an import_std configuration in the test-set

ensure that we have an import_std configuration in the test-set #370

Workflow file for this run

# The MIT License (MIT)
#
# Copyright (c) 2018 Mateusz Pusz
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name: Freestanding CI
on:
push:
branches:
- '**'
paths-ignore:
- "docs/**"
pull_request:
branches:
- '**'
paths-ignore:
- "docs/**"
workflow_dispatch:
inputs:
matrix-seed:
description: The random seed for the subset of the full test-matrix to be run (set to '0' to select one at random)
required: true
type: number
default: 0
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
generate-matrix:
name: "Generate build matrix for ${{ github.workflow }}"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- id: set-matrix
run: python .github/generate-job-matrix.py --preset freestanding --seed ${{ inputs.matrix-seed || 0 }} --debug combinations counts
build:
name: "${{ matrix.platform.name }} C++${{ matrix.std }} ${{ matrix.formatting }} ${{ matrix.contracts }} ${{ matrix.build_type }}"
runs-on: ${{ matrix.platform.os }}
needs: generate-matrix
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
env:
CC: ${{ matrix.platform.compiler.cc }}
CXX: ${{ matrix.platform.compiler.cxx }}
steps:
- uses: actions/checkout@v4
- run: echo "cache_id=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_ENV
- name: Cache Conan data
uses: actions/cache@v4
if: always()
env:
cache-name: cache-conan-data
with:
path: ~/.conan2/p
key: freestanding-${{ matrix.platform.os }}-${{ matrix.formatting }}-${{ matrix.contracts }}-${{ matrix.platform.compiler.type }}-${{ matrix.platform.lib }}-${{ matrix.build_type }}-${{ matrix.platform.compiler.version }}-${{ matrix.std }}-${{ env.cache_id }}
restore-keys: |
freestanding-${{ matrix.platform.os }}-${{ matrix.formatting }}-${{ matrix.contracts }}-${{ matrix.platform.compiler.type }}-${{ matrix.platform.lib }}-${{ matrix.build_type }}-${{ matrix.platform.compiler.version }}-${{ matrix.std }}-
freestanding-${{ matrix.platform.os }}-${{ matrix.formatting }}-${{ matrix.contracts }}-${{ matrix.platform.compiler.type }}-${{ matrix.platform.lib }}-${{ matrix.build_type }}-${{ matrix.platform.compiler.version }}-
freestanding-${{ matrix.platform.os }}-${{ matrix.formatting }}-${{ matrix.contracts }}-${{ matrix.platform.compiler.type }}-${{ matrix.platform.lib }}-${{ matrix.build_type }}-
freestanding-${{ matrix.platform.os }}-${{ matrix.formatting }}-${{ matrix.contracts }}-${{ matrix.platform.compiler.type }}-${{ matrix.platform.lib }}-
freestanding-${{ matrix.platform.os }}-${{ matrix.formatting }}-${{ matrix.contracts }}-${{ matrix.platform.compiler.type }}-
freestanding-${{ matrix.platform.os }}-${{ matrix.formatting }}-${{ matrix.contracts }}-
freestanding-${{ matrix.platform.os }}-${{ matrix.formatting }}-
freestanding-${{ matrix.platform.os }}-
- uses: hendrikmuhs/[email protected]
if: runner.os == 'Linux'
with:
key: ${{ matrix.platform.os }}-${{ matrix.formatting }}-${{ matrix.contracts }}-${{ matrix.platform.compiler.type }}-${{ matrix.platform.lib }}-${{ matrix.build_type }}-${{ matrix.platform.compiler.version }}-${{ matrix.std }}
max-size: 50M
- name: Install Clang
if: matrix.platform.compiler.type == 'CLANG'
shell: bash
working-directory: ${{ env.HOME }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.platform.compiler.version }}
sudo apt install -y clang-tools-${{ matrix.platform.compiler.version }}
- name: Install Libc++
if: matrix.platform.compiler.type == 'CLANG' && matrix.platform.lib == 'libc++'
shell: bash
run: |
sudo apt install -y libc++-${{ matrix.platform.compiler.version }}-dev libc++abi-${{ matrix.platform.compiler.version }}-dev libunwind-${{ matrix.platform.compiler.version }}-dev
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install Ninja
shell: bash
run: |
pip install -U ninja
- name: Install Conan
shell: bash
run: |
pip install -U conan
- name: Configure Conan
shell: bash
run: |
conan profile detect --force
if [[ "${{ matrix.platform.compiler.type }}" == "CLANG" ]]; then
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.libcxx=.*/compiler.libcxx=${{ matrix.platform.lib }}/' ~/.conan2/profiles/default
fi
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.cppstd=.*/compiler.cppstd=${{ matrix.std }}/' ~/.conan2/profiles/default
sed -i.backup '/^\[settings\]$/,/^\[/ s/^build_type=.*/build_type=${{ matrix.build_type }}/' ~/.conan2/profiles/default
conan profile show -pr default
- run: echo "std_format=$([ "${{ matrix.formatting }}" == "std::format" ] && echo "True" || echo "False")" >> $GITHUB_ENV
- name: Build freestanding
shell: bash
run: |
conan build . -b missing -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
-c user.mp-units.build:all=True -c tools.build:cxxflags="['-ffreestanding']" \
${{ matrix.conan-config }}
- name: Clean Conan cache before backup
shell: bash
run: |
conan remove *#~latest --confirm
conan remove *:*#~latest --confirm
conan cache clean "*" -s -b -d