Skip to content

fix build on 24.04

fix build on 24.04 #13

Workflow file for this run

name: Build and Test
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: release
jobs:
prep:
runs-on: ubuntu-24.04
outputs:
repo_lower: ${{ steps.repo.outputs.repo_lower }}
steps:
- id: repo
run: |
echo "repo_lower=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
build-devcontainer:
needs: prep
strategy:
matrix:
runner: [ubuntu-24.04, ubuntu-24.04-arm]
include:
- runner: ubuntu-24.04
platform: linux/amd64
arch: amd64
- runner: ubuntu-24.04-arm
platform: linux/arm64
arch: arm64
runs-on: ${{ matrix.runner }}
permissions:
contents: read
pull-requests: write
packages: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Container to Registry
uses: docker/build-push-action@v5
with:
context: .
file: .devcontainer/Dockerfile
platforms: ${{ matrix.platform }}
push: true
tags: |
ghcr.io/${{ needs.prep.outputs.repo_lower }}/devcontainer:stable-${{ matrix.arch }}
ghcr.io/${{ needs.prep.outputs.repo_lower }}/devcontainer:${{ github.sha }}-${{ matrix.arch }}
cache-from: type=gha
cache-to: type=gha,mode=max
build:
needs: [prep, build-devcontainer]
strategy:
matrix:
runner: [ubuntu-24.04, ubuntu-24.04-arm]
include:
- runner: ubuntu-24.04
arch: amd64
- runner: ubuntu-24.04-arm
arch: arm64
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: read
container:
image: ghcr.io/${{ needs.prep.outputs.repo_lower }}/devcontainer:${{ github.sha }}-${{ matrix.arch }}
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Configure CMake
run: cmake --preset "${{ env.BUILD_TYPE }}"
- name: Build
run: cmake --build --preset "${{ env.BUILD_TYPE }}"
test:
needs: [prep, build-devcontainer]
strategy:
matrix:
runner: [ubuntu-24.04, ubuntu-24.04-arm]
include:
- runner: ubuntu-24.04
arch: amd64
- runner: ubuntu-24.04-arm
arch: arm64
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: read
container:
image: ghcr.io/${{ needs.prep.outputs.repo_lower }}/devcontainer:${{ github.sha }}-${{ matrix.arch }}
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Test
run: |
cmake --preset "${{ env.BUILD_TYPE }}"
cmake --build --preset "${{ env.BUILD_TYPE }}"
ctest --test-dir ./build/"${{ env.BUILD_TYPE }}"
analyze:
needs: [prep, build-devcontainer]
strategy:
matrix:
runner: [ubuntu-24.04, ubuntu-24.04-arm]
include:
- runner: ubuntu-24.04
arch: amd64
- runner: ubuntu-24.04-arm
arch: arm64
runs-on: ${{ matrix.runner }}
permissions:
contents: read
packages: read
container:
image: ghcr.io/${{ needs.prep.outputs.repo_lower }}/devcontainer:${{ github.sha }}-${{ matrix.arch }}
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Configure CMake
run: cmake --preset "${{ env.BUILD_TYPE }}"
- name: Build
run: cmake --build --preset "${{ env.BUILD_TYPE }}"
- name: Analyze
run: ./scripts/clang-tidy-fix.sh "${{ env.BUILD_TYPE }}" --no-fix