ensure pass on CI

This commit is contained in:
Ashwin Naren
2026-02-19 10:14:00 -08:00
parent d2d1ba2cbf
commit 303041553a

View File

@@ -24,23 +24,33 @@ jobs:
- 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
docker run moss "/bin/bash" -c "cargo test -r --no-default-features" >> out.log
docker run moss "/bin/bash" -c "cargo run -r --no-default-features -- /bin/usertest" >> usertest.log
docker run moss "/bin/bash" -c "cargo test -r --no-default-features" >> unittest.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
docker run moss "/bin/bash" -c "cargo test -r --no-default-features --features "${{ matrix.smp-feature }}"" >> 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
docker run moss "/bin/bash" -c "cargo run -r --no-default-features --features "${{ matrix.smp-feature }}" -- /bin/usertest" >> usertest.log
docker run moss "/bin/bash" -c "cargo test -r --no-default-features --features "${{ matrix.smp-feature }}"" >> unittest.log
- name: Display usertest output
run: cat usertest.log
- name: Display unit test output
run: cat unittest.log
- name: Check for usertest success line
run: grep -q "All tests passed in " usertest.log || (echo "Usertests failed" && exit 1)
- name: Check for unit test success line
run: |
grep -q "test result: .*ok.*\..*passed" unittest.log || (echo "Unit tests failed" && exit 1)
- name: Upload usertest output as artifact
uses: actions/upload-artifact@v6
with:
name: test-output-${{ matrix.smp-feature || 'up' }}
path: out.log
name: usertest-output-${{ matrix.smp-feature || 'up' }}
path: usertest.log
- name: Upload unittest output as artifact
uses: actions/upload-artifact@v6
with:
name: unittest-output-${{ matrix.smp-feature || 'up' }}
path: unittest.log
upload-image:
runs-on: ubuntu-latest