Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: continuous integration #6

Merged
merged 18 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a0063d9
gha/linux: Built a general purpose build workflow for Linux
dragonmux Aug 21, 2023
d4ad6e7
gha/linux: Implemented code coverage builds
dragonmux Aug 21, 2023
5ced0d0
gha/windows: Built a general purpose build workflow for MSVC and MSYS…
dragonmux Aug 21, 2023
a4def34
gha/windows: Implemented code coverage builds
dragonmux Aug 21, 2023
02c9759
misc: Added a check that substrate is enabling the command line optio…
dragonmux Aug 22, 2023
1c779be
bmpflash: Fixed a typo in the help output license epilogue
dragonmux Aug 24, 2023
ec6303f
meson: Added a compiler check for MSVC to ensure we get a new enough …
dragonmux Aug 31, 2023
46ee837
gha/windows: Disabled the MSVC flow for now due to GHA sporting too o…
dragonmux Sep 1, 2023
48b4f04
gha/macos: Built a general purpose build workflow for macOS
dragonmux Sep 1, 2023
0ca7d42
gha/macos: Extended the workflow to include homebrew GCC-based builds
dragonmux Sep 1, 2023
ffa827f
remoteSPI: Quelled the defined-but-unused warning about `remoteRespon…
dragonmux Sep 2, 2023
d771946
bmp: Fixed two nullptr deference warnings in bmp_t's constructor
dragonmux Sep 2, 2023
7d794c0
meson: Enabled `-ftrapv` where possible to turn signed integer overfl…
dragonmux Sep 2, 2023
6f5a799
remoteSPI: Fixed a few more warnings from lib{fmt} by suppressing the…
dragonmux Sep 2, 2023
18d3676
workflows/build-macos: use BUILD_OPTS env variable
rg-silva Sep 19, 2023
e5b7aad
workflows: declare empty BUILD_OPTS
rg-silva Sep 19, 2023
1cf08cb
workflows/build-macos: add comment about test
rg-silva Sep 19, 2023
27a876b
gha/macos: Disabled the Homebrew flow for now due to link issues
dragonmux Sep 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: Build Linux

on:
push:
branches-ignore:
- 'coverityScan'
pull_request:
branches:
- 'main'

concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-linux:
name: '${{ matrix.os.id }} (${{ matrix.compiler }})'
runs-on: ${{ matrix.os.id }}
strategy:
matrix:
os:
- { id: ubuntu-22.04, name: jammy }
compiler:
- 'clang-13'
- 'clang-15'
- 'clang-16'
- 'clang-17'
- 'gcc-9'
- 'gcc-11'
- 'gcc-12'
- 'gcc-13'
fail-fast: false
env:
BUILD_OPTS: ''
steps:
- name: Runtime environment
shell: bash
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
- name: Setup 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
echo "GCOV=${CC/#gcc/gcov}" >> $GITHUB_ENV
env:
CC: ${{ matrix.compiler }}
- name: Setup 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
echo "GCOV=${CC/#clang/llvm-cov} gcov" >> $GITHUB_ENV
env:
CC: ${{ matrix.compiler }}
working-directory: ${{ runner.temp }}
- name: Remove old LLVM 12 plugins
if: matrix.compiler != 'clang-12'
run: |
sudo apt purge llvm-12-linker-tools
- name: Remove old LLVM 13 plugins
if: matrix.compiler != 'clang-13'
run: |
sudo apt purge llvm-13-linker-tools
- name: Remove old LLVM 14 plugins
if: matrix.compiler != 'clang-14'
run: |
sudo apt purge llvm-14-linker-tools
- name: Remove old LLVM 15 plugins
if: matrix.compiler != 'clang-15'
run: |
sudo apt purge llvm-15-linker-tools
- name: Install dependencies
shell: bash
run: sudo apt-get install libudev-dev
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja + gcovr
shell: bash
run: |
sudo python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install --user meson ninja gcovr
working-directory: ${{ runner.temp }}
- name: Version tools
shell: bash
run: |
$CC --version
$CXX --version
$GCOV --version
meson --version
ninja --version
- name: Configure
run: meson setup build --prefix=$HOME/.local $BUILD_OPTS
- name: Build
run: meson compile -C build
- name: Test
run: meson test -C build
- name: Install
run: meson install -C build
- name: Run coverage build
if: github.repository == 'blackmagic-debug/bmpflash' && matrix.compiler != 'clang-17'
# Codecov no longer parses gcov files automatically
run: |
rm -rf build
meson setup build --prefix=$HOME/.local -Db_coverage=true --buildtype=debug
meson compile -C build
meson test -C build
ninja -C build coverage-xml
- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs-${{ matrix.os.id }}-${{ matrix.compiler }}
path: ${{ github.workspace }}/build/meson-logs/*
retention-days: 5
- name: Codecov
if: success() && github.repository == 'blackmagic-debug/bmpflash' && matrix.compiler != 'clang-17'
uses: codecov/codecov-action@v3
with:
directory: ./build/meson-logs/
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
176 changes: 176 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
name: Build macOS

on:
push:
branches-ignore:
- 'coverityScan'
pull_request:
branches:
- 'main'

concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-macos:
name: '${{ matrix.os }} (Apple Clang)'
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os:
- macos-12
- macos-11
build_opts:
- ''
include:
# static+LTO forced build to uncover any potential symbols issues with Mach-O
# single test to save runners as they are scarse and should validate all possible configurations
- os: macos-latest
build_opts: '-Db_lto=true -Ddefault_library=static'
fail-fast: false
env:
BUILD_OPTS: ${{ matrix.build_opts }}
steps:
- name: Runtime environment
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja + gcovr
run: |
brew install meson ninja gcovr
working-directory: ${{ runner.temp }}
- name: Version tools
run: |
cc --version || true
ld --version || true
gcov --version || true
meson --version
ninja --version
- name: Configure
run: meson setup build --prefix=$HOME/.local $BUILD_OPTS
- name: Build
run: meson compile -C build
- name: Test
run: meson test -C build
- name: Install
run: meson install -C build
- name: Run coverage build
if: github.repository == 'blackmagic-debug/bmpflash'
# Codecov no longer parses gcov files automatically
run: |
rm -rf build
meson setup build --prefix=$HOME/.local -Db_coverage=true --buildtype=debug $BUILD_OPTS
meson compile -C build
meson test -C build
ninja -C build coverage-xml
- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs-${{ matrix.os }}-appleclang
path: ${{ github.workspace }}/build/meson-logs/*
retention-days: 5
- name: Codecov
if: success() && github.repository == 'blackmagic-debug/bmpflash'
uses: codecov/codecov-action@v3
with:
directory: ./build/meson-logs/
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}

build-macos-homebrew:
# Apple LLD is unable to link GCC < 11 generated object files.
# https://stackoverflow.com/questions/73714336/xcode-update-to-version-2395-ld-compile-problem-occurs-computedatomcount-m
# rdar://FB11369327
name: '${{ matrix.os }} (homebrew, ${{ matrix.compiler }})'
runs-on: ${{ matrix.os }}
if: false
defaults:
run:
shell: bash
strategy:
matrix:
os:
- macos-11
compiler:
- gcc@9
- gcc@11
- gcc@12
- gcc@13 # needs hardcoding for the GCOV replacement
fail-fast: false
env:
BUILD_OPTS: ''
steps:
- name: Runtime environment
env:
WORKSPACE: ${{ github.workspace }}
run: |
echo "GITHUB_WORKSPACE=`pwd`" >> $GITHUB_ENV
- name: Setup compiler
run: |
brew install ${{ matrix.compiler }}
CC=${COMPILER/@/-}
CXX=${CC/#gcc/g++}
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
echo "GCOV=${CC/#gcc/gcov}" >> $GITHUB_ENV
env:
COMPILER: ${{ matrix.compiler }}
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Meson + Ninja + gcovr
run: |
brew install meson ninja gcovr
working-directory: ${{ runner.temp }}
- name: Version tools
shell: bash
run: |
$CC --version
$CXX --version
$GCOV --version
meson --version
ninja --version
- name: Configure
run: meson setup build --prefix=$HOME/.local $BUILD_OPTS
- name: Build
run: meson compile -C build
- name: Test
run: meson test -C build
- name: Install
run: meson install -C build
- name: Run coverage build
if: github.repository == 'blackmagic-debug/bmpflash'
# Codecov no longer parses gcov files automatically
run: |
rm -rf build
meson setup build --prefix=$HOME/.local -Db_coverage=true --buildtype=debug
meson compile -C build
meson test -C build
ninja -C build coverage-xml
- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs-${{ matrix.os }}-homebrew-${{ matrix.compiler }}
path: ${{ github.workspace }}/build/meson-logs/*
retention-days: 5
- name: Codecov
if: success() && github.repository == 'blackmagic-debug/bmpflash'
uses: codecov/codecov-action@v3
with:
directory: ./build/meson-logs/
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
Loading