Multi-System Docker Tests #68
This file contains hidden or 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
| name: Multi-System Docker Tests | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| schedule: | |
| # Run tests weekly on Sunday at 3 AM UTC | |
| - cron: '0 3 * * 0' | |
| env: | |
| FIXOS_TEST_MODE: 1 | |
| jobs: | |
| # ═══════════════════════════════════════════════════════════ | |
| # Fedory Tests | |
| # ═══════════════════════════════════════════════════════════ | |
| test-fedora: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Fedora image | |
| run: | | |
| docker build -f docker/fedora/Dockerfile -t fixos-test:fedora . | |
| - name: Test on Fedora | |
| run: | | |
| docker run --rm fixos-test:fedora bash -c " | |
| echo '=== Fedora Test ===' && | |
| fixos --version || true && | |
| fixos scan --help && | |
| pip install pytest pytest-mock --quiet && | |
| python -m pytest tests/unit/ -v --tb=short -x | |
| " | |
| # ═══════════════════════════════════════════════════════════ | |
| # Ubuntu Tests | |
| # ═══════════════════════════════════════════════════════════ | |
| test-ubuntu: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Ubuntu image | |
| run: | | |
| docker build -f docker/ubuntu/Dockerfile -t fixos-test:ubuntu . | |
| - name: Test on Ubuntu | |
| run: | | |
| docker run --rm fixos-test:ubuntu bash -c " | |
| echo '=== Ubuntu Test ===' && | |
| fixos --version || true && | |
| fixos scan --help && | |
| pip install pytest pytest-mock --quiet && | |
| python -m pytest tests/unit/ -v --tb=short -x | |
| " | |
| # ═══════════════════════════════════════════════════════════ | |
| # Debian Tests | |
| # ═══════════════════════════════════════════════════════════ | |
| test-debian: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Debian image | |
| run: | | |
| docker build -f docker/debian/Dockerfile -t fixos-test:debian . | |
| - name: Test on Debian | |
| run: | | |
| docker run --rm fixos-test:debian bash -c " | |
| echo '=== Debian Test ===' && | |
| fixos --version || true && | |
| fixos scan --help && | |
| pip install pytest pytest-mock --quiet && | |
| python -m pytest tests/unit/ -v --tb=short -x | |
| " | |
| # ═══════════════════════════════════════════════════════════ | |
| # Arch Linux Tests | |
| # ═══════════════════════════════════════════════════════════ | |
| test-arch: | |
| runs-on: ubuntu-latest | |
| continue-on-error: true # Arch is rolling release, might fail occasionally | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Arch image | |
| run: | | |
| docker build -f docker/arch/Dockerfile -t fixos-test:arch . || echo "Arch build may fail due to rolling updates" | |
| - name: Test on Arch | |
| run: | | |
| docker run --rm fixos-test:arch bash -c " | |
| echo '=== Arch Linux Test ===' && | |
| fixos --version || true && | |
| fixos scan --help && | |
| pip install pytest pytest-mock --quiet && | |
| python -m pytest tests/unit/ -v --tb=short -x | |
| " || echo "Arch test may fail due to rolling updates" | |
| # ═══════════════════════════════════════════════════════════ | |
| # Alpine Tests (minimal system) | |
| # ═══════════════════════════════════════════════════════════ | |
| test-alpine: | |
| runs-on: ubuntu-latest | |
| continue-on-error: true # Alpine uses musl, might have compatibility issues | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Alpine image | |
| run: | | |
| docker build -f docker/alpine/Dockerfile -t fixos-test:alpine . | |
| - name: Test on Alpine | |
| run: | | |
| docker run --rm fixos-test:alpine bash -c " | |
| echo '=== Alpine Test ===' && | |
| fixos --version || true && | |
| fixos scan --help && | |
| pip install pytest pytest-mock --quiet && | |
| python -m pytest tests/unit/ -v --tb=short -x | |
| " || echo "Alpine test may fail due to musl libc differences" | |
| # ═══════════════════════════════════════════════════════════ | |
| # Summary | |
| # ═══════════════════════════════════════════════════════════ | |
| test-summary: | |
| needs: [test-fedora, test-ubuntu, test-debian, test-arch, test-alpine] | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Test Summary | |
| run: | | |
| echo "═══════════════════════════════════════════════════════════" | |
| echo " Multi-System Docker Tests Summary" | |
| echo "═══════════════════════════════════════════════════════════" | |
| echo "" | |
| echo "Fedora: ${{ needs.test-fedora.result }}" | |
| echo "Ubuntu: ${{ needs.test-ubuntu.result }}" | |
| echo "Debian: ${{ needs.test-debian.result }}" | |
| echo "Arch: ${{ needs.test-arch.result }} (rolling release)" | |
| echo "Alpine: ${{ needs.test-alpine.result }} (musl libc)" | |
| echo "" | |
| # Check if core systems passed (Fedora, Ubuntu, Debian) | |
| if [[ "${{ needs.test-fedora.result }}" == "success" && \ | |
| "${{ needs.test-ubuntu.result }}" == "success" && \ | |
| "${{ needs.test-debian.result }}" == "success" ]]; then | |
| echo "✅ Core systems tests passed!" | |
| exit 0 | |
| else | |
| echo "❌ Some core system tests failed!" | |
| exit 1 | |
| fi |