Major overhaul of testing #195
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: Test/Build | |
| # TODO: also run cargo clippy? | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| # This tests the CLI and core lib functionality | |
| cli_test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: gleesus/decktricks | |
| steps: | |
| - name: Preserve $HOME set in the container | |
| run: echo HOME=/root >> "$GITHUB_ENV" | |
| - uses: actions/checkout@v4 | |
| - name: Run CLI Tests | |
| run: cargo test | |
| cli_test_release: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: gleesus/decktricks | |
| steps: | |
| - name: Preserve $HOME set in the container | |
| run: echo HOME=/root >> "$GITHUB_ENV" | |
| - uses: actions/checkout@v4 | |
| - name: Run CLI Tests (Release) | |
| run: cargo test --release | |
| # TODO: package CLI into separate tar here | |
| gui_test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: gleesus/decktricks | |
| steps: | |
| - name: Preserve $HOME set in the container | |
| run: echo HOME=/root >> "$GITHUB_ENV" | |
| - uses: actions/checkout@v4 | |
| - name: Run GUI Tests | |
| run: cd gui/rust && cargo test | |
| gui_test_release: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: gleesus/decktricks | |
| steps: | |
| - name: Preserve $HOME set in the container | |
| run: echo HOME=/root >> "$GITHUB_ENV" | |
| - uses: actions/checkout@v4 | |
| - name: Run GUI Tests (Release) | |
| run: cd gui/rust && cargo test --release | |
| # This tests only some basic GUI functionality | |
| gui_build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: gleesus/decktricks | |
| steps: | |
| - name: Preserve $HOME set in the container | |
| run: echo HOME=/root >> "$GITHUB_ENV" | |
| - uses: actions/checkout@v4 | |
| - run: ./ci_scripts/init.sh | |
| # NOTE: the following steps could be parallelized, if it helps | |
| - run: ./ci_scripts/place_build_assets.sh | |
| - run: ./ci_scripts/cli.sh | |
| - run: ./ci_scripts/gui.sh | |
| - name: Verify GUI tests pass before building | |
| run: cd gui/rust && cargo test --release | |
| - run: ./ci_scripts/compress.sh | |
| - name: Create tarball checksum file | |
| run: | | |
| cd ./build | |
| xxh64sum decktricks.tar.xz > DECKTRICKS_TARBALL_XXH64SUM | |
| # These are separate so that if-no-files-found actually errors if just one is missing {{{ | |
| - name: Upload tarball | |
| if: ${{ !env.ACT }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: verified-gui-tar | |
| path: ./build/decktricks.tar.xz | |
| if-no-files-found: error | |
| - name: Upload installer desktop | |
| if: ${{ !env.ACT }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: verified-gui-installer-desktop | |
| path: ./build/decktricks-install.desktop | |
| if-no-files-found: error | |
| - name: Upload installer script | |
| if: ${{ !env.ACT }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: verified-gui-installer-script | |
| path: ./build/decktricks-install.sh | |
| if-no-files-found: error | |
| - name: Upload update script | |
| if: ${{ !env.ACT }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: verified-gui-update-script | |
| path: ./build/decktricks-update.sh | |
| if-no-files-found: error | |
| - name: Upload tarball checksum | |
| if: ${{ !env.ACT }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: verified-gui-tar-checksum | |
| path: ./build/DECKTRICKS_TARBALL_XXH64SUM | |
| if-no-files-found: error | |
| # }}} | |
| # TODO: ensure this is enough gating to prevent branch/main PRs from triggering latest tags | |
| update_latest_branch: | |
| if: github.event_name == 'push' | |
| needs: | |
| - gui_build | |
| - cli_test | |
| - cli_test_release | |
| - gui_test | |
| - gui_test_release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update latest branch | |
| run: | | |
| ./scripts/update_latest_branch.sh | |
| update_latest_release: | |
| if: github.event_name == 'push' | |
| needs: | |
| - update_latest_branch | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: mkdir /tmp/artifacts | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: /tmp/artifacts | |
| - run: find /tmp/artifacts | |
| - name: Create latest release | |
| uses: softprops/action-gh-release@v2 | |
| #if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| fail_on_unmatched_files: true | |
| prerelease: true | |
| name: Latest RC | |
| tag_name: latest | |
| make_latest: false | |
| body: A release candidate for pushing out. This has passed all automated tests and should be safe to use, but has not yet received human verification. | |
| files: | | |
| /tmp/artifacts/verified-gui-tar/decktricks.tar.xz | |
| /tmp/artifacts/verified-gui-installer-desktop/decktricks-install.desktop | |
| /tmp/artifacts/verified-gui-installer-script/decktricks-install.sh | |
| /tmp/artifacts/verified-gui-update-script/decktricks-update.sh | |
| /tmp/artifacts/verified-gui-tar-checksum/DECKTRICKS_TARBALL_XXH64SUM |