Merge pull request #25 from asdf-format/issue-3 #83
This file contains hidden or 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
name: Build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
inputs: | |
make_flags: | |
description: Extra flags to pass to make | |
required: false | |
default: '' | |
jobs: | |
build-and-test: | |
name: Build and run `make check` | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
cc: [gcc, clang] | |
exclude: | |
- os: macos-latest | |
cc: gcc | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install dependencies (Ubuntu) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
autoconf \ | |
automake \ | |
libtool \ | |
build-essential \ | |
libfyaml-dev | |
if [ "${{ matrix.cc }}" = "clang" ]; then | |
sudo apt-get install -y clang | |
fi | |
- name: Install dependencies (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
brew update | |
brew install \ | |
autoconf \ | |
automake \ | |
libtool \ | |
argp-standalone \ | |
libfyaml | |
- name: Bootstrap autotools | |
run: ./autogen.sh | |
- name: Configure | |
run: ./configure CC=${{ matrix.cc }} | |
- name: Build | |
run: make ${{ github.event.inputs.make_flags }} | |
- name: Check | |
run: make check ${{ github.event.inputs.make_flags }} | |
- name: Output test logs on failure | |
if: failure() | |
run: | | |
tail -n +1 tests/*.log | |
tail -n +1 tests/tmp/*.out.txt | |
- name: Dist | |
run: make dist ${{ github.event.inputs.make_flags }} | |
- name: Dist check | |
run: make distcheck ${{ github.event.inputs.make_flags }} |