Quick Tests #6
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: Quick Tests | |
| on: | |
| workflow_run: | |
| workflows: ["Validate Workflows"] | |
| types: [completed] | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| quick-tests: | |
| name: Quick Tests | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Cache FFmpeg binaries | |
| uses: actions/cache@v4 | |
| with: | |
| path: src/vendor/ffmpeg | |
| key: ffmpeg-binaries-${{ runner.os }}-v1 | |
| restore-keys: | | |
| ffmpeg-binaries-${{ runner.os }}- | |
| - name: Setup Zig | |
| uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.15.1 | |
| - name: Cache Zig build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .zig-cache | |
| zig-out | |
| key: zig-build-quick-${{ runner.os }}-${{ hashFiles('build.zig', 'src/**/*.zig') }} | |
| restore-keys: | | |
| zig-build-quick-${{ runner.os }}- | |
| zig-build-${{ runner.os }}- | |
| - name: Run unit tests | |
| run: zig build test | |
| - name: Quick build test | |
| run: zig build | |
| - name: Quick functionality test | |
| run: | | |
| mkdir -p test-media | |
| # Very quick tests - 1 second duration, small resolution | |
| ./zig-out/bin/media-gen video --duration 1 --width 160 --height 120 --output test-media/quick_video.mp4 | |
| ./zig-out/bin/media-gen audio --duration 1 --sample-rate 8000 --output test-media/quick_audio.mp3 | |
| ./zig-out/bin/media-gen help | |
| # Verify files exist and have reasonable size | |
| if [[! -f test-media/quick_video.mp4]] || [[$(stat -c%s test-media/quick_video.mp4) -lt 100]]; then | |
| echo "Video test failed" | |
| exit 1 | |
| fi | |
| if [[! -f test-media/quick_audio.mp3]] || [[$(stat -c%s test-media/quick_audio.mp3) -lt 100]]; then | |
| echo "Audio test failed" | |
| exit 1 | |
| fi | |
| echo "✅ Quick tests passed" |