diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..844bc2f --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,25 @@ +--- +name: 'test' +on: + push: + branches: + - refactor/wm_properties + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install test dependencies + run: sudo apt-get install -y i3-wm gcc gpick xterm + + - name: Setup test environment + uses: coactions/setup-xvfb@v1 + with: + run: script/test_env.sh + options: :99.0 + + - name: Run tests + run: cargo test diff --git a/script/run_tests.sh b/script/run_tests.sh index 24a6ce6..5563953 100755 --- a/script/run_tests.sh +++ b/script/run_tests.sh @@ -1,3 +1,3 @@ vagrant up -vagrant ssh -c "cd /vagrant; script/setup.sh; cargo clean; cargo test" +vagrant ssh -c "cd /vagrant; script/xvfb.sh; script/test_env.sh; cargo clean; cargo test" vagrant halt diff --git a/script/setup.sh b/script/test_env.sh similarity index 86% rename from script/setup.sh rename to script/test_env.sh index 89f6a65..d5b5386 100755 --- a/script/setup.sh +++ b/script/test_env.sh @@ -1,6 +1,4 @@ export DISPLAY=:99.0 -Xvfb :99.0 & -sleep 3 i3 -c /dev/null & sleep 3 gpick & diff --git a/script/xvfb.sh b/script/xvfb.sh new file mode 100755 index 0000000..7456fc2 --- /dev/null +++ b/script/xvfb.sh @@ -0,0 +1,2 @@ +Xvfb :99.0 & +sleep 3