Skip to content

Unit Tests

Unit Tests #30

Workflow file for this run

name: Unit Tests
on:
push:
branches:
- tls
paths:
- src/tls/*
workflow_dispatch:
env:
AUTOTESTER_ROM: ${{github.workspace}}/CE.rom
LWIP_TESTS: ${{github.workspace}}/tests
CEMU_PATH: ${{github.workspace}}/CEmu
HOST_DOMAIN: "https://cagstech.com"
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: Checkout TLS branch
uses: actions/checkout@v4
with:
ref: 'tls'
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y make tar
- name: Download and extract CEdev
run: |
curl -sL github.com/CE-Programming/toolchain/releases/download/v11.2/CEdev-Linux.tar.gz | tar xz
- name: Add CEdev to PATH
run: |
echo "${{github.workspace}}/CEdev/bin" >> $GITHUB_PATH
echo $GITHUB_PATH
- name: Download and extract CEmu
run: |
curl -sL https://github.com/CE-Programming/CEmu/releases/download/nightly/CEmu-nightly_linux64_qt6_static -o CEmu
chmod +x CEmu
- name: Download CEmu Rom
run: |
curl -sL https://cagstech.com/resources/CE.rom -o ${{env.AUTOTESTER_ROM}}
- name: Run Unit Tests
run: |
find ${{env.LWIP_TESTS}} -name autotest.json -print0 | {
failed=0
while read -d '' test; do
make -C $(dirname $test) all test || cmake -E true $((failed += $?))
done
cmake -E echo "$failed tests failed"
exit $failed
}
- name: Remove CEmu Rom
if: always()
run: rm CE.rom