Skip to content

Tweak logo ASCII art for markdown rendering #58

Tweak logo ASCII art for markdown rendering

Tweak logo ASCII art for markdown rendering #58

Workflow file for this run

name: Linmo CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
matrix-tests:
runs-on: ubuntu-24.04
name: Test on ${{ matrix.toolchain }} toolchain
strategy:
fail-fast: false
matrix:
toolchain: [gnu, llvm]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install base dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential qemu-system-riscv32 wget clang-format-18 shfmt
- name: Check code formatting
run: .ci/check-format.sh
- name: Check newline at end of files
run: .ci/check-newline.sh
- name: Setup ${{ matrix.toolchain }} toolchain
run: .ci/setup-toolchain.sh ${{ matrix.toolchain }}
- name: Verify toolchain installation
run: |
if [ "${{ matrix.toolchain }}" = "gnu" ]; then
riscv32-unknown-elf-gcc --version
else
# LLVM toolchain fallback: try system llvm-objdump
riscv32-unknown-elf-clang --version || clang --version
riscv32-unknown-elf-llvm-objdump --version || llvm-objdump --version
fi
qemu-system-riscv32 --version
- name: Build Kernel
run: |
make clean
make
env:
TOOLCHAIN_TYPE: ${{ matrix.toolchain }}
- name: Run All Apps
id: test
continue-on-error: true
if: matrix.toolchain == 'gnu'
run: |
output=$(.ci/run-app-tests.sh 2>&1) || true
echo "TEST_OUTPUT<<EOF" >> $GITHUB_OUTPUT
echo "$output" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
env:
TOOLCHAIN_TYPE: ${{ matrix.toolchain }}
- name: Run Functional Tests
id: functional_test
continue-on-error: true
if: matrix.toolchain == 'gnu'
run: |
output=$(.ci/run-functional-tests.sh 2>&1) || true
echo "FUNCTIONAL_TEST_OUTPUT<<EOF" >> $GITHUB_OUTPUT
echo "$output" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
env:
TOOLCHAIN_TYPE: ${{ matrix.toolchain }}
- name: Collect Test Data
if: always()
run: |
if [ "${{ matrix.toolchain }}" = "llvm" ]; then
# LLVM: Build-only validation, skip tests
mkdir -p test-results
echo "${{ matrix.toolchain }}" > test-results/toolchain
echo "skipped" > test-results/crash_exit_code
echo "skipped" > test-results/functional_exit_code
# Generate skipped status for all apps
apps=$(find app/ -name "*.c" -exec basename {} .c \; | sort)
for app in $apps; do
echo "$app=skipped" >> test-results/apps_data
done
# Generate skipped status for functional tests
echo "mutex=skipped" > test-results/functional_data
echo "semaphore=skipped" >> test-results/functional_data
# Generate skipped status for functional test criteria
echo "mutex:fairness=skipped" > test-results/functional_criteria_data
echo "mutex:mutual_exclusion=skipped" >> test-results/functional_criteria_data
echo "mutex:data_consistency=skipped" >> test-results/functional_criteria_data
echo "mutex:overall=skipped" >> test-results/functional_criteria_data
echo "semaphore:all_tests_passed!=skipped" >> test-results/functional_criteria_data
echo "LLVM toolchain: Build validation only (tests skipped)"
else
# GNU: Full test suite
.ci/ci-tools.sh collect-data "${{ matrix.toolchain }}" "${{ steps.test.outputs.TEST_OUTPUT }}" "${{ steps.functional_test.outputs.FUNCTIONAL_TEST_OUTPUT }}"
fi
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.toolchain }}
path: test-results/
retention-days: 1
# Comprehensive test summary with detailed reporting
test-summary:
runs-on: ubuntu-24.04
needs: matrix-tests
if: always()
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Download Test Results
uses: actions/download-artifact@v4
with:
pattern: test-results-*
path: all-test-results/
- name: Generate Test Summary
continue-on-error: true
run: |
.ci/ci-tools.sh aggregate all-test-results test-summary.toml
cat test-summary.toml
- name: Upload Test Summary
if: always()
uses: actions/upload-artifact@v4
with:
name: test-summary
path: test-summary.toml
retention-days: 30
- name: Comment PR with Formatted Summary
if: always() && github.event_name == 'pull_request'
continue-on-error: true
run: |
.ci/ci-tools.sh post-comment test-summary.toml ${{ github.event.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Final Status Check
run: |
if [ ! -f test-summary.toml ]; then
echo "Error: test-summary.toml not found"
exit 1
fi
overall_status=$(grep -A 1 '^\[summary\]' test-summary.toml | grep 'status =' | cut -d'"' -f2)
echo "Overall test status: $overall_status"
if [ "$overall_status" = "passed" ]; then
echo "✅ All tests passed"
exit 0
else
echo "❌ Tests failed"
exit 1
fi