Skip to content

More workflow updates #5

More workflow updates

More workflow updates #5

Workflow file for this run

name: Test builds
on:
push:
branches:
- main
workflow_dispatch:
jobs:
setup-matrix:
runs-on: ubuntu-latest
name: Test changed files
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
with:
json: true
files: |
*/src/day*.cpp
*/src/lib.h*
*/Makefile
# reference: https://stackoverflow.com/a/65094398
- name: Setup matrix combinations
id: setup-matrix-combinations
run: |
python ${GITHUB_WORKSPACE}/.github/workflows/gen_matrix.py "${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
outputs:
matrix-combinations: ${{ steps.setup-matrix-combinations.outputs.matrix-combinations }}
matrix-job:
runs-on: ubuntu-latest
needs: setup-matrix
strategy:
matrix:
${{ fromJson(needs.setup-matrix.outputs.matrix-combinations) }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get -qq -y install clang g++>=9.3.0
- name: Build targets
run: |
cd ${{ matrix.dir }}
make -j2 CXX=${{ matrix.compiler }} DISABLE_BEAR=TRUE build/release/${{ matrix.target }} build/debug/${{ matrix.target }}