Fix indentation #17
This file contains 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 | |
# TODO: package CLI into separate tar here | |
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 | |
# This tests only some basic GUI functionality | |
gui_build_and_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 build script | |
run: ./scripts/build_decktricks_gui.sh release | |
- name: Get binary from tar | |
run: | | |
mkdir /tmp/decktricks_work | |
tar xvf ./build/decktricks.tar.gz -C /tmp/decktricks_work | |
- name: Run GUI e2e scripts | |
run: ./scripts/run_all_gui_e2e_tests.sh /tmp/decktricks_work/decktricks-gui | |
- name: Upload tar | |
uses: actions/upload-artifact@v4 | |
with: | |
name: verified-gui-tar | |
path: ./build/decktricks.tar.gz | |
if-no-files-found: error | |
- name: Upload installer | |
uses: actions/upload-artifact@v4 | |
with: | |
name: verified-gui-installer | |
path: ./build/decktricks_install.desktop | |
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_and_test | |
- cli_test | |
- cli_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 | |
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.gz | |
/tmp/artifacts/verified-gui-installer/decktricks_install.desktop |