Skip to content

Commit

Permalink
Test the produced zip files in GitHub Actions (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Mar 4, 2023
1 parent f2b1e1d commit 8705b9a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 10 additions & 6 deletions runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8705b9a

Please sign in to comment.