From 8705b9aa7e9a2315733e067709b76e8485244c3c Mon Sep 17 00:00:00 2001 From: Akuli Date: Sat, 4 Mar 2023 18:38:06 +0200 Subject: [PATCH] Test the produced zip files in GitHub Actions (#295) --- .github/workflows/windows.yml | 18 ++++++++++++++++++ runtests.sh | 16 ++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2c78fa2b..5a23cf99 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -61,6 +61,24 @@ jobs: - run: cd "test dir" && source activate && ./runtests.sh --verbose shell: bash + test-zip: + needs: build-zip + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + with: + path: repo + - uses: actions/download-artifact@v3 + with: + name: windows-zip + - run: unzip jou.zip + - run: cp -r repo/tests repo/runtests.sh jou + shell: bash + - run: cd jou && ./jou.exe --verbose examples/hello.jou + shell: bash + - run: cd jou && ./runtests.sh --dont-run-make --verbose + shell: bash + compare-compilers: runs-on: windows-latest steps: diff --git a/runtests.sh b/runtests.sh index 8fb75c6c..cdca205c 100755 --- a/runtests.sh +++ b/runtests.sh @@ -12,18 +12,20 @@ export LANG=C # "Segmentation fault" must be in english for this script to work set -e -o pipefail function usage() { - echo "Usage: $0 [--valgrind] [--verbose] [TEMPLATE]" >&2 + echo "Usage: $0 [--valgrind] [--verbose] [--dont-run-make] [TEMPLATE]" >&2 echo "TEMPLATE can be e.g. './jou %s', where %s will be replaced by a jou file." >&2 exit 2 } valgrind=no verbose=no +run_make=yes while [[ "$1" =~ ^- ]]; do case "$1" in --valgrind) valgrind=yes; shift ;; --verbose) verbose=yes; shift ;; + --dont-run-make) run_make=no; shift ;; *) usage ;; esac done @@ -45,11 +47,13 @@ if [ $valgrind = yes ]; then command_template="valgrind -q --leak-check=full --show-leak-kinds=all --suppressions=valgrind-suppressions.sup $command_template" fi -if [[ "$OS" =~ Windows ]]; then - source activate - mingw32-make -else - make +if [ $run_make = yes ]; then + if [[ "$OS" =~ Windows ]]; then + source activate + mingw32-make + else + make + fi fi rm -rf tmp/tests