mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
name: Unit Testing
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
run:
|
|
name: Run Luau Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
output1: ${{ steps.run_tests.outputs.result }}
|
|
|
|
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 "result=$output" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Check Unit Tests
|
|
env:
|
|
OUTPUT1: ${{ needs.run_tests.outputs.result }}
|
|
run: |
|
|
if [[ "${{ needs.run_tests.outputs.result }}" == *"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
|