This repository has been archived by the owner on Sep 25, 2024. It is now read-only.
PR example with a failing test #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI checks + deployment | |
on: | |
pull_request: | |
branches: production | |
push: | |
branches: production | |
jobs: | |
install-tools: | |
name: Install tools | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- uses: Roblox/setup-foreman@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache Foreman tools | |
uses: actions/[email protected] | |
with: | |
path: ~/.foreman | |
key: tools-${{ hashFiles('foreman.toml') }} | |
linting: | |
name: Lint with Selene | |
runs-on: ubuntu-latest | |
needs: [install-tools] | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Restore cached Foreman tools | |
uses: actions/[email protected] | |
with: | |
path: ~/.foreman | |
key: tools-${{ hashFiles('foreman.toml') }} | |
- name: Lint | |
run: ./scripts/shell/lint.sh src | |
formatting: | |
name: Format with StyLua | |
runs-on: ubuntu-latest | |
needs: [install-tools] | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Restore cached Foreman tools | |
uses: actions/[email protected] | |
with: | |
path: ~/.foreman | |
key: tools-${{ hashFiles('foreman.toml') }} | |
- name: Check format | |
run: ./scripts/shell/check-format.sh src | |
luau-tests: | |
name: Run Luau tests via Open Cloud | |
runs-on: ubuntu-latest | |
needs: [install-tools] | |
concurrency: | |
group: luau-execution | |
cancel-in-progress: false | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Restore cached Foreman tools | |
uses: actions/[email protected] | |
with: | |
path: ~/.foreman | |
key: tools-${{ hashFiles('foreman.toml') }} | |
- name: Run tests | |
run: ./scripts/shell/test.sh default.project.json $TEST_TASK_FILE | |
env: | |
ROBLOX_API_KEY: ${{ secrets.ROBLOX_API_KEY }} | |
ROBLOX_UNIVERSE_ID: ${{ vars.ROBLOX_TEST_UNIVERSE_ID }} | |
ROBLOX_PLACE_ID: ${{ vars.ROBLOX_TEST_PLACE_ID }} | |
TEST_TASK_FILE: tasks/runTests.luau | |
deployment: | |
name: Deployment | |
runs-on: ubuntu-latest | |
needs: [install-tools, linting, formatting, luau-tests] # Only runs if all checks passed | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/production' }} # Only runs on pushes to production | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Restore cached Foreman tools | |
uses: actions/[email protected] | |
with: | |
path: ~/.foreman | |
key: tools-${{ hashFiles('foreman.toml') }} | |
- name: Publish | |
run: $HOME/.foreman/bin/rojo upload default.project.json --api_key ${{ secrets.ROBLOX_API_KEY }} --universe_id ${{ vars.ROBLOX_PRODUCTION_UNIVERSE_ID }} --asset_id ${{ vars.ROBLOX_PRODUCTION_PLACE_ID }} |