Skip to content

Commit

Permalink
Finish setting up GUI e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAwesome committed Nov 27, 2024
1 parent f74646c commit 81aa1e0
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 10 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/build_godot_gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,28 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
gui_tests:

runs-on: ubuntu-latest
container:
image: gleesus/decktricks

steps:
- uses: actions/checkout@v4

- name: Build GUI Rust
run: cargo build
working-directory: ./gui/rust

- name: Make build dir
run: mkdir -p ./gui/godot/build

- name: Copy Rust Lib to Godot
run: cp ./gui/rust/target/debug/libdecktricks_godot_gui.so ./gui/godot/build

- name: Build GUI
run: godot --headless --export-debug Linux
working-directory: ./gui/godot

- name: Run GUI e2e scripts
run: ./scripts/run_all_gui_e2e_tests.sh
16 changes: 7 additions & 9 deletions .github/workflows/rust_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
cli_build_and_test:

runs-on: ubuntu-latest
container:
image: gleesus/decktricks

steps:
- uses: actions/checkout@v4
- name: Install Flatpak
run: |
sudo apt update
sudo apt install -y flatpak
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Build CLI
run: cargo build
- name: Run Tests
run: cargo test
3 changes: 3 additions & 0 deletions scripts/build_local_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ set -euxo pipefail
# To avoid needing sudo to run docker commands, run this and then log out and back in:
# sudo usermod -aG docker $USER

# To install buildx on Arch:
# sudo pacman -S docker-buildx

cd "$(dirname "$0")"/../misc/act-docker
docker build -t decktricks-act .
16 changes: 16 additions & 0 deletions scripts/run_all_gui_e2e_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -euxo pipefail

cd "$(dirname "$0")"/..

for script in scripts/tests/test_*.sh; do
set +x
echo
echo "=================================="
echo "= Running: $script"
echo "=================================="
echo
set -x
./"$script"
done
1 change: 1 addition & 0 deletions scripts/tests/test_gui_startup_speed.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ source "$(dirname "$0")"/lib.sh
# in scripts/tests/test_gui_does_not_exit.sh
export DECKTRICKS_GUI_EXIT_IMMEDIATELY=true
timeout 4 "${DECKTRICKS_TEST_COMMAND[@]}" 2>&1
RETCODE="$?"

if [[ "$RETCODE" == "124" ]]; then
exit 1
Expand Down

0 comments on commit 81aa1e0

Please sign in to comment.