mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-01-30 09:01:44 -05:00
39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build-test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
smp-feature: [ "", "smp" ]
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- name: Build dockerfile
|
|
run: docker build -t moss .
|
|
# If all features are disabled
|
|
- name: Run tests inside docker container
|
|
if: ${{ matrix.smp-feature == '' }}
|
|
run: docker run moss "/bin/bash" -c "cargo run -r --no-default-features -- /bin/usertest" >> out.log
|
|
# If any feature is enabled
|
|
- name: Run tests inside docker container
|
|
if: ${{ matrix.smp-feature == 'smp' }}
|
|
run: docker run moss "/bin/bash" -c "cargo run -r --no-default-features --features "${{ matrix.smp-feature }}" -- /bin/usertest" >> out.log
|
|
- name: Display test output
|
|
run: cat out.log
|
|
- name: Check for success line
|
|
run: grep -q "All tests passed in " out.log || (echo "Tests failed" && exit 1)
|
|
- name: Upload test output as artifact
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: test-output-${{ matrix.smp-feature || 'up' }}
|
|
path: out.log
|