Skip to content

clang-tidy: Added misc-include-cleaner to the ignored checks as it'… #608

clang-tidy: Added misc-include-cleaner to the ignored checks as it'…

clang-tidy: Added misc-include-cleaner to the ignored checks as it'… #608

name: build and upload
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# This controls the concurrency level for the jobs and how it's calculated
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a job for each supported OS in the form `build-<os>`
build-linux:
# The type of runner that the job will run on
runs-on: ${{ matrix.os.id }}
# We define a matrix of compilers and OS versions to build against so we can cover a variety of
# suitable compilation environments and early discover issues
strategy:
matrix:
os:
- {id: ubuntu-20.04, name: focal}
compiler:
- 'clang-9'
- 'clang-15'
- 'gcc-9'
- 'gcc-11'
arm-compiler:
- '12.2.Rel1'
include:
- os: {id: ubuntu-20.04, name: focal}
compiler: gcc-9
arm-compiler: '10-2020-q4'
fail-fast: false
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Build a suitable runtime environment
- name: Runtime environment
shell: bash
env:
WORKSPACE: ${{ github.workspace }}
# The GITHUB_WORKSPACE step here fixes https://github.com/actions/runner/issues/2058 which is an ongoing issue.
run: |
echo "$GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
# Install a suitable system compiler for the build
- name: Setup system GCC
if: startsWith(matrix.compiler, 'gcc')
shell: bash
run: |
CXX=${CC/#gcc/g++}
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install $CC $CXX
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
env:
CC: ${{ matrix.compiler }}
- name: Setup system Clang
if: startsWith(matrix.compiler, 'clang')
shell: bash
run: |
wget https://apt.llvm.org/llvm-snapshot.gpg.key
sudo apt-key add llvm-snapshot.gpg.key
rm llvm-snapshot.gpg.key
sudo apt-add-repository "deb https://apt.llvm.org/${{ matrix.os.name }}/ llvm-toolchain-${{ matrix.os.name }}${CC/#clang/} main"
sudo apt-get update
sudo apt-get install $CC
CXX=${CC/#clang/clang++}
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
env:
CC: ${{ matrix.compiler }}
working-directory: ${{ runner.temp }}
# Install the dependencies needed for a full BMDA build
- name: Install BMDA dependencies
run: sudo apt-get -y install libc6-dev-i386 libusb-dev libftdi1-dev libhidapi-dev
# Setup and use a suitable ARM GCC for the firmware
- name: Setup ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: ${{ matrix.arm-compiler }}
# Record the versions of all the tools used in the build
- name: Version tools
shell: bash
run: |
$CC --version
arm-none-eabi-gcc --version
make --version
# Checkout the repository and branch to build under the default location
- name: Checkout
uses: actions/checkout@v4
# Build the firmware for all platform variants and full BMDA
- name: Build all platform variants firmware and Linux BMDA
run: |
make all_platforms
mv src/artifacts/blackmagic-{hosted,bmda}
# Package up all the artefacts and upload them
- name: Archive firmware build artifacts as a zip
uses: actions/upload-artifact@v3
with:
name: blackmagic-linux_${{ matrix.os.name }}-${{ matrix.compiler }}+arm-${{ matrix.arm-compiler }}
path: src/artifacts/*
if-no-files-found: error
build-windows-mingw:
# Name the job more appropriately so we can tell which windows and which MinGW ABI is in use
name: 'build-mingw (${{ matrix.os }}, ${{ matrix.sys.abi }})'
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
# Set the shell so run steps will execute from in msys2 correctly by default
defaults:
run:
shell: msys2 {0}
# We define a matrix of compilers and OS versions to build against so we can cover a variety of
# suitable compilation environments and early discover issues
strategy:
matrix:
os:
- windows-2019
- windows-2022
sys:
- {abi: mingw64, env: x86_64, compiler: gcc}
- {abi: ucrt64, env: ucrt-x86_64, compiler: gcc}
- {abi: clang64, env: clang-x86_64, compiler: clang}
fail-fast: false
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Install a suitable system compiler for the build
- name: Use MinGW from MSYS
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys.abi}}
update: true
path-type: inherit
install: >-
mingw-w64-${{matrix.sys.env}}-toolchain
# Build a suitable runtime environment
- name: Runtime environment
env:
WORKSPACE: ${{ github.workspace }}
# The GITHUB_WORKSPACE step here fixes https://github.com/actions/runner/issues/2058 which is an ongoing issue.
run: |
echo "$GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
# Configure the system toolchain environment
- name: Setup system GCC
if: matrix.sys.compiler == 'gcc'
run: |
CXX=${CC/#gcc/g++}
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
env:
CC: ${{ matrix.sys.compiler }}
- name: Setup system Clang
if: matrix.sys.compiler == 'clang'
run: |
CXX=${CC/#clang/clang++}
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
env:
CC: ${{ matrix.sys.compiler }}
# Install the dependencies needed for a full BMDA build
- name: Install BMDA dependencies
run: |
pacman --noconfirm -S mingw-w64-${{matrix.sys.env}}-libusb mingw-w64-${{matrix.sys.env}}-libftdi \
mingw-w64-${{matrix.sys.env}}-hidapi
# Setup and use a suitable ARM GCC for the firmware
- name: Setup ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '12.2.Rel1'
# Record the versions of all the tools used in the build
- name: Version tools
shell: bash
run: |
$CC --version
arm-none-eabi-gcc --version
make --version
# Checkout the repository and branch to build under the default location
- name: Checkout
uses: actions/checkout@v4
# Build the firmware for all platform variants and full BMDA
- name: Build all platform variants firmware and Windows BMDA
run: |
make all_platforms
make -C src clean
make PROBE_HOST=hosted HOSTED_BMP_ONLY=0
mv src/artifacts/blackmagic-{hosted,bmda-bmp-only}.exe
mv src/blackmagic.exe src/artifacts/blackmagic-bmda-full.exe
# Package up all the artefacts and upload them
- name: Archive firmware build artifacts as a zip
uses: actions/upload-artifact@v3
with:
name: blackmagic-windows_${{ matrix.os }}-${{ matrix.sys.abi }}-${{ matrix.sys.compiler }}
path: src/artifacts/*
if-no-files-found: error