mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 01:20:04 +00:00
36 lines
971 B
YAML
36 lines
971 B
YAML
name: Unit Testing
|
|
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
jobs:
|
|
run:
|
|
name: Run Luau Tests
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 2
|
|
|
|
steps:
|
|
- name: Checkout Project
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Luau
|
|
uses: encodedvenom/install-luau@v2.1
|
|
|
|
- uses: actions/checkout@v4
|
|
- uses: JohnnyMorganz/stylua-action@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
version: latest # NOTE: we recommend pinning to a specific version in case of formatting changes
|
|
# CLI arguments
|
|
args: --check src
|
|
|
|
- name: Run Unit Tests
|
|
id: run_tests
|
|
run: |
|
|
output=$(luau test/tests.luau)
|
|
echo "$output"
|
|
if [[ "$output" == *"0 fails"* ]]; then
|
|
echo "Unit Tests Passed"
|
|
else
|
|
echo "Error: One or More Unit Tests Failed."
|
|
exit 1
|
|
fi
|