mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
Add Continuous Integration (#76)
* First attempt at CI * second attempt * attempt 3 * attempt 4 * Try using git env * Combine steps * Rename * Run last step at all costs * (testing workflow to see if it passes when it should) * Workflow dispatch * Revert commit that made unit tests pass (intentional)
This commit is contained in:
parent
9cd00aacb4
commit
44780f7f7b
1 changed files with 37 additions and 0 deletions
37
.github/workflows/ci.yaml
vendored
Normal file
37
.github/workflows/ci.yaml
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
name: Unit Testing
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
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"
|
||||
if [[ "$output" == *"0 fails"* ]]; then
|
||||
echo "Unit Tests Passed"
|
||||
else
|
||||
echo "Error: One or More Unit Tests Failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Cleanup Luau Binaries
|
||||
if: '!cancelled()'
|
||||
run: rm luau && rm luau-analyze && rm luau-compile && rm luau-ubuntu.zip && rm luau-link.txt
|
Loading…
Reference in a new issue