Skip to content

GHI #20 Fix workflow files #63

GHI #20 Fix workflow files

GHI #20 Fix workflow files #63

Workflow file for this run

name: Run All Tests
on:
pull_request:
branches:
- '**'
jobs:
test-native:
strategy:
matrix:
# verbose labels make things easier to read in GitHub Actions
# platform gets converted to os, preset, compiler, architecture
platform:
- windows-gcc-x86_64
- windows-msvc-x86_32
- windows-msvc-x86_64
- macos-clang-x86_64
- linux-clang-x86_64
- linux-gcc-x86_64
# convert verbose labels to usable values (which don't appear in GitHub Actions GUI)
include:
# platform -> os, preset, compiler, architecture
- platform: windows-gcc-x86_64
os: windows
preset: patomic-ci-native-unix-gcc
architecture: x86_64
- platform: windows-msvc-x86_32
os: windows
preset: patomic-ci-native-win32-msvc
architecture: x86_32
- platform: windows-msvc-x86_64
os: windows
preset: patomic-ci-native-win64-msvc
architecture: x86_64
- platform: macos-clang-x86_64
os: macos
preset: patomic-ci-native-unix-clang
architecture: x86_64
- platform: linux-clang-x86_64
os: ubuntu
preset: patomic-ci-native-unix-clang
architecture: x86_64
- platform: linux-gcc-x86_64
os: ubuntu
preset: patomic-ci-native-unix-gcc
architecture: x86_64
uses: doodspav/patomic/.github/workflows/reusable-test-native.yml@feature/ghi-20-inner-stuff
with:
os: ${{ matrix.os }}
preset: ${{ matrix.preset }}
architecture: ${{ matrix.architecture }}
# test-qemu:
# strategy:
# matrix:
# # architecture gets converted to triple
# # short form here so that it doesn't take up the whole GitHub Action name
# architecture:
# - aarch64
# # - alpha todo: uncomment
# - arm
# - armhf
# # - hppa todo: uncomment
# # fixme: m68k is supported, but ICEs clang and segfaults qemu when built with gcc (GHI #25)
# # - m68k
# - mips
# - mips64
# - mips64el
# - mipsel
# - ppc
# - ppc64
# - ppc64le
# # - riscv64 todo: uncomment
# - s390x
# # fixme: sh4 is supported (only for gcc), but segfaults qemu when built with gcc (GHI #25)
# # - sh4
# # - sparc64 todo:uncomment
# # - x86_32 todo: uncomment
# # convert architectures to triples
# include:
# - architecture: aarch64
# triple: aarch64-linux-gnu
# # - architecture: alpha
# # triple: alpha-linux-gnu
# - architecture: arm
# triple: arm-linux-gnueabi
# - architecture: armhf
# triple: arm-linux-gnueabihf
# # - architecture: hppa
# # triple: hppa-linux-gnu
# # - architecture: m68k
# # triple: m68k-linux-gnu
# - architecture: mips
# triple: mips-linux-gnu
# - architecture: mips64
# triple: mips64-linux-gnuabi64
# - architecture: mips64el
# triple: mips64el-linux-gnuabi64
# - architecture: mipsel
# triple: mipsel-linux-gnu
# - architecture: ppc
# triple: powerpc-linux-gnu
# - architecture: ppc64
# triple: powerpc64-linux-gnu
# - architecture: ppc64le
# triple: powerpc64le-linux-gnu
# # - architecture: riscv64
# # triple: riscv64-linux-gnu
# - architecture: s390x
# triple: s390x-linux-gnu
# # - architecture: sh4
# # triple: sh4-linux-gnu
# # - architecture: sparc64
# # triple: sparc64-linux-gnu
# # - architecture: x86_32
# # triple: i686-linux-gnu
# uses: doodspav/patomic/.github/workflows/reusable-test-qemu.yml@feature/ghi-20-inner-stuff
# with:
# triple: ${{ matrix.triple }}
# architecture: ${{ matrix.architecture }}
#
# publish-results:
# runs-on: ubuntu-latest
# needs:
# - test-native
# - test-qemu
#
# steps:
# - name: Download Test Result Artifacts
# uses: actions/download-artifact@v3
# with:
# name: test-results
# path: test-results/
#
# - name: Publish Test Results
# uses: EnricoMi/publish-unit-test-result-action@v2
# with:
# action_fail: true
# action_fail_on_inconclusive: true
# check_name: "Tests Results: Warning"
# files: test-results/**/*.xml
publish-coverage:
runs-on: ubuntu-latest
needs:
- test-native
# - test-qemu
strategy:
matrix:
include:
- hi_limit: 100
- lo_limit: 90
steps:
- name: Install Dependencies
run: |
sudo apt update
sudo apt install binutils # for c++filt
sudo apt install llvm
sudo apt install lcov
- name: Download Test Coverage Artifacts
uses: actions/download-artifact@v3
with:
name: test-coverage-internal
path: test-coverage-internal/
- name: Delete Test Coverage Artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: test-coverage-internal
- name: Get Root Compilation Dir
id: get-path
run: |
# this only contains directories
dir_names=(test-coverage-internal/*)
# all directories have the same root path
root_path="test-coverage-internal/${dir_names[0]}/patomic.rootpath
# save path for future steps
echo "root_compilation_dir=${root_path}" >> $GITHUB_OUTPUT
- name: Checkout patomic
uses: actions/checkout@v4
with:
repository: patomic
path: "${{ steps.get-path.root_compiler_dir }}/patomic"
- name: Create Lcov Config File
run: |
touch lcovrc
echo "genhtml_hi_limit = ${{ matrix.hi_limit }}" >> lcovrc
echo "genhtml_med_limit = ${{ matrix.med_limit }}" >> lcovrc
echo "genhtml_function_hi_limit = ${{ matrix.hi_limit }}" >> lcovrc
echo "genhtml_function_med_limit = ${{ matrix.med_limit }}" >> lcovrc
echo "Contents of lcovrc:
echo "-------------------"
cat lcovrc
- name: Generate HTML Files
run: |
# directory into which to put user artifacts
mkdir test-coverage
# generate lcov and html files for each separate compilation
for dir in $(find ./test-coverage-internal -not -path '*/*' -type d -mindepth 1 -maxdepth 1); do
arch=$(basename "${dir}")
touch "${dir}/patomic.profdata" # avoid out-of-date warning
mkdir "./test-coverage/${arch}"
llvm-cov export -format=lcov -instr-profile="${dir}/patomic.profdata" -object="${dir}/patomic.bin" >> "./test-coverage/${arch}/patomic.lcov"
genhtml --output-directory "./test-coverage/${arch}" --title "patomic-${arch}" --show-details --num-spaces 4 --legend --demangle-cpp --config-file ./lcovrc --precision 2 "./test-coverage/${arch}/patomic.lcov"
done
- name: Upload Coverage Results
uses: actions/upload-artifact@v3
with:
name: test-coverage
path: test-coverage/
- name: Create Coverage Summary
uses: irongut/CodeCoverageSummary@v1
with:
filename: test-coverage/**/patomic.lcov
badge: true
fail_below_min: true
thresholds: '${{ matrix.med_limit }} ${{ matrix.hi_limit }}'