break #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: 0BSD | |
############################################################################# | |
# | |
# Author: Jia Tan | |
# | |
############################################################################# | |
name: CI | |
on: [push, fork] | |
jobs: | |
POSIX: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
build_system: [autotools, cmake] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 | |
######################## | |
# Install Dependencies # | |
######################## | |
# Install Autotools on Linux | |
- name: Install Dependencies | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen musl-tools valgrind | |
# Install Autotools on Mac | |
- name: Install Dependencies | |
if: ${{ matrix.os == 'macos-latest' && matrix.build_system == 'autotools' }} | |
run: brew install autoconf automake libtool po4a doxygen | |
# Install CMake on Linux | |
- name: Install Dependencies | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'cmake' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential cmake musl-tools | |
# Install CMake on Mac | |
- name: Install Dependencies | |
if: ${{ matrix.os == 'macos-latest' && matrix.build_system == 'cmake' }} | |
run: brew install cmake | |
################## | |
# Build and Test # | |
################## | |
# -b specifies the build system to use. | |
# -p specifies the phase (build or test) to help narrow down an error | |
# if one occurs. | |
# | |
# The first two builds/tests are only run on Autotools Linux and | |
# affect the CFLAGS. Resetting the CFLAGS requires clearing the | |
# config cache between runs, so the tests that require CFLAGS are | |
# done first. | |
- name: Build with Valgrind | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} | |
run: ./build-aux/ci_build.sh -b autotools -p build -d sandbox -w "notvalgrind --trace-children=yes" | |
- name: Test with Valgrind | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} | |
run: | | |
./build-aux/ci_build.sh -b autotools -p test -d sandbox -w "notvalgrind --trace-children=yes" | |
cat ../xz_build/*/test-suite.log | |
cd ../xz_build && make distclean | |
# Attempt to upload the test logs as artifacts if any step has failed | |
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4.0.0 | |
if: ${{ failure() }} | |
with: | |
name: ${{ matrix.os }} ${{ matrix.build_system }} Test Logs | |
path: build-aux/artifacts |