From 7cfea0eebeb7713b826645c8d9574669659edf9f Mon Sep 17 00:00:00 2001 From: Trebor-Huang <2300936257@qq.com> Date: Sun, 31 Oct 2021 23:13:12 +0800 Subject: [PATCH] Try using composite --- .github/actions/automatic-test/action.yml | 33 +++++++++++++++++++++++ .github/workflows/dev.yml | 16 +---------- 2 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 .github/actions/automatic-test/action.yml diff --git a/.github/actions/automatic-test/action.yml b/.github/actions/automatic-test/action.yml new file mode 100644 index 00000000..7609d80a --- /dev/null +++ b/.github/actions/automatic-test/action.yml @@ -0,0 +1,33 @@ +name: 'Automatic Test' +description: 'Check for obvious errors.' + +runs: + using: "composite" + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/build-love + with: + file-path: Techmino.love + - name: Download love + run: | + curl -L https://github.com/love2d/love/releases/download/11.3/love-11.3-linux-x86_64.tar.gz | tar xz + - name: Prepare PulseAudio + run: | + sudo apt-get update + sudo apt-get install pulseaudio pulseaudio-utils pavucontrol alsa-oss alsa-utils -y + - name: Run automated test + uses: GabrielBB/xvfb-action@v1 + with: + run: | + if [ ./dest/love Techmino.love --test ]; then + echo "Passed" > .github/workflows/automatic-test/result.txt + else + exit 1 # xvfb seems to return 0 even if the test failed + fi + - name: Finish + run: | + if [ -f .github/workflows/automatic-test/result.txt ]; then + exit 0 + else + exit 1 + fi \ No newline at end of file diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 7053baa5..f20427db 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -31,21 +31,7 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - - uses: ./.github/actions/build-love - with: - file-path: Techmino.love - - name: Download love - run: | - curl -L https://github.com/love2d/love/releases/download/11.3/love-11.3-linux-x86_64.tar.gz | tar xz - - name: Prepare PulseAudio - run: | - sudo apt-get update - sudo apt-get install pulseaudio pulseaudio-utils pavucontrol alsa-oss alsa-utils -y - - name: Run automated test - uses: GabrielBB/xvfb-action@v1 - with: - run: | - ./dest/love Techmino.love --test + - uses: ./.github/actions/automatic-test build-windows: runs-on: windows-latest