90 lines
1.9 KiB
YAML
90 lines
1.9 KiB
YAML
name: Continous Integration
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
analyze:
|
|
name: Analyze
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rokit
|
|
uses: CompeyDev/setup-rokit@v0.1.2
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Analyze
|
|
run: lune run analyze
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rokit
|
|
uses: CompeyDev/setup-rokit@v0.1.2
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Lint
|
|
run: |
|
|
selene lib/
|
|
|
|
style:
|
|
name: Styling
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Check code style
|
|
uses: JohnnyMorganz/stylua-action@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
version: v0.20.0
|
|
args: --check lib/
|
|
|
|
test:
|
|
name: Unit Testing
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Luau
|
|
uses: encodedvenom/install-luau@v2.1
|
|
|
|
- name: Install Rokit
|
|
uses: CompeyDev/setup-rokit@v0.1.2
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install Packages
|
|
run: |
|
|
pesde install
|
|
|
|
# Not needed anymore thanks to pesde 🥳
|
|
#- name: Download Jecs
|
|
# run: |
|
|
# lune run download-jecs ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Run Unit 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
|