Add qemu emulation + CI tests #26
Workflow file for this run
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: Apache-2.0 | |
name: Build | |
on: | |
push: | |
branches: [ '*' ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup nix | |
uses: ./.github/actions/setup-nix | |
- name: Astyle | |
shell: nix develop .#ci -c bash -e {0} | |
run: | | |
err=$(astyle $(git ls-files "*.c" "*.h") --options=.astylerc --dry-run --formatted) | |
if [[ ${#err} != 0 ]]; then | |
echo "$err" | awk '{split($0,a);print a[2]}' | while IFS= read -r file; do | |
echo "::error file={"$file"},title={checking}::Formatted $file" | |
done | |
exit 1 | |
fi | |
- name: Build targets | |
shell: nix develop .#ci -c bash -e {0} | |
run: | | |
make | |
emulate_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup nix | |
uses: ./.github/actions/setup-nix | |
- name: Emulate on QEMU | |
shell: nix develop .#ci -c bash -e {0} | |
run: | | |
make emulate | |
for file in elf/*.elf; do | |
make emulate ELF_FILE="$file" | |
done |