[WIP] Workflow for basic testing across multiple archs #10
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
name: Multiarch checks | |
on: | |
pull_request: | |
branches: [ develop, master ] | |
push: | |
branches: [ develop, master ] | |
paths-ignore: | |
- 'doygen/**' | |
- 'hooks/**' | |
- 'licenses/**' | |
- 'LICENSE.md' | |
- 'README.md' | |
- 'RELEASE-NOTES.txt' | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
multiarch-prim-rev: | |
name: ${{ matrix.config.platform }} ${{ matrix.config.batch }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { platform: arm/v6, batch: 0} | |
- { platform: arm/v6, batch: 1} | |
- { platform: arm/v6, batch: 2} | |
- { platform: arm/v6, batch: 3} | |
- { platform: arm/v6, batch: 4} | |
- { platform: arm/v6, batch: 5} | |
- { platform: arm/v6, batch: 6} | |
- { platform: arm/v6, batch: 7} | |
- { platform: arm/v6, batch: 8} | |
- { platform: arm/v6, batch: 9} | |
- { platform: arm/v6, batch: 10} | |
- { platform: arm/v6, batch: 11} | |
- { platform: arm/v6, batch: 12} | |
- { platform: arm/v6, batch: 13} | |
- { platform: arm/v6, batch: 14} | |
- { platform: arm/v6, batch: 15} | |
- { platform: arm/v6, batch: 16} | |
- { platform: arm/v6, batch: 17} | |
- { platform: arm/v6, batch: 18} | |
- { platform: arm/v6, batch: 19} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: docker/setup-qemu-action@v2 | |
- uses: addnab/docker-run-action@v3 | |
with: | |
image: debian:sid-slim | |
options: -v ${{ github.workspace }}:/work --platform linux/${{ matrix.config.platform }} -e DEBIAN_FRONTEND=noninteractive | |
run: | | |
apt-get update && apt-get install -y build-essential python-is-python3 | |
cd /work | |
PrimTests=(test/unit/math/prim/prob/*.cpp test/unit/math/prim/core/*.cpp test/unit/math/prim/meta/*.cpp test/unit/math/prim/err/*.cpp test/unit/math/prim/functor/*.cpp) | |
NTests=${#PrimTests[@]} | |
TestsPerBatch="$(($NTests / 20))" | |
StartOfBatch="$((${{ matrix.config.batch }} * $TestsPerBatch))" | |
# Compile and run in sub-batches of 5 to fail faster | |
echo "${PrimTests[@]:${StartOfBatch}:${TestsPerBatch}}" | xargs -n 5 python ./runTests.py -j2 | |
shell: bash | |
- name: Upload gtest_output xml | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: gtest_outputs_xml | |
path: '**/*_test.xml' |