From 5d3abe6208435884ba57112ab69763fb4c2ef806 Mon Sep 17 00:00:00 2001 From: EncodedVenom Date: Sat, 13 Jul 2024 19:48:37 -0400 Subject: [PATCH] First attempt at CI --- .github/workflows/ci.yaml | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..b04ec79 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,40 @@ +name: Unit Testing + +on: [push, pull_request] + +jobs: + run: + name: Run Luau Tests + runs-on: ubuntu-latest + + steps: + - name: Checkout Project + uses: actions/checkout@v3 + + - name: Fetch Luau Latest Release + run: curl -s https://api.github.com/repos/luau-lang/luau/releases/latest | grep /luau-ubuntu.zip | cut -d '"' -f 4 > luau-link.txt + + - name: Download Luau Latest Release + run: wget -i luau-link.txt + + - name: Unzip binary + run: unzip luau-ubuntu.zip + + - name: Run Unit Tests + id: run_tests + run: | + output=$(./luau tests/world.luau) + echo "$output" + echo "$output" > "$GITHUB_OUTPUT" + + - name: Check Unit Tests + run: | + if [[ "$GITHUB_OUTPUT" == *"0 fails"* ]]; then + echo "Unit Tests Passed" + else + echo "Error: One or More Unit Tests Failed." + exit 1 + fi + + - name: Cleanup Luau Binaries + run: rm luau && rm luau-analyze && rm luau-compile && rm luau-ubuntu.zip && rm luau-link.txt