Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
pull_request:
branches:
- main

jobs:
branch-naming:
name: Validate branch name
runs-on: ubuntu-latest
steps:
- name: Check branch name format
run: |
BRANCH="${{ github.head_ref }}"
echo "Checking branch name: $BRANCH"

# Must start with a valid prefix
if [[ ! "$BRANCH" =~ ^(feature|bugfix|hotfix|chore|docs|refactor|test)/ ]]; then
echo "::error::Branch name must start with a valid prefix (feature/, bugfix/, hotfix/, chore/, docs/, refactor/, test/)"
exit 1
fi

# After prefix, must be lowercase kebab-case
SUFFIX="${BRANCH#*/}"
if [[ ! "$SUFFIX" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then
echo "::error::Branch name after prefix must be lowercase kebab-case (e.g., feature/my-new-feature)"
exit 1
fi

echo "Branch name is valid."

format:
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Setup Rokit
uses: CompeyDev/setup-rokit@v0.1.2

- name: Check formatting
run: lune run ./Submodules/luau-cicd/Scripts/CheckFormatting.luau

test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Setup Rokit
uses: CompeyDev/setup-rokit@v0.1.2

- name: Install dependencies
run: wally install

- name: Run tests
run: lune run ./Scripts/RunTests.luau

analyze:
name: Static analysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Setup Rokit
uses: CompeyDev/setup-rokit@v0.1.2

- name: Install dependencies
run: wally install

- name: Setup Lune typedefs
run: lune setup --no-update-luaurc

- name: Run static analysis
run: luau-lsp analyze --ignore "Source/Testable/init.luau" --ignore "Submodules/**" --platform standard .
23 changes: 0 additions & 23 deletions .github/workflows/format.yml

This file was deleted.

77 changes: 68 additions & 9 deletions .github/workflows/release-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,48 @@ on:
- release

jobs:
test:
name: Run tests
pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- name: Check PR title format
run: |
TITLE="${{ github.event.pull_request.title }}"
echo "Checking PR title: $TITLE"

# Must be exactly "Release X.Y.Z"
if [[ ! "$TITLE" =~ ^Release\ [0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::PR title must be exactly 'Release X.Y.Z' (e.g., 'Release 1.2.3')"
exit 1
fi

echo "PR title is valid."

diff-check:
name: Verify diff matches main
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- name: Setup Rokit
uses: CompeyDev/setup-rokit@v0.1.2
- name: Check diff with main
run: |
git fetch origin main

- name: Install dependencies
run: wally install
# Get the diff between the PR branch and main
DIFF=$(git diff origin/main..HEAD)

- name: Run tests
run: lune run ./Scripts/RunTests.luau
if [ -n "$DIFF" ]; then
echo "::error::PR branch has changes that differ from main. The release branch must contain exactly what is in main."
echo "Diff:"
echo "$DIFF"
exit 1
fi

echo "PR branch matches main exactly."

format:
name: Check formatting
Expand All @@ -39,6 +64,24 @@ jobs:
- name: Check formatting
run: lune run ./Submodules/luau-cicd/Scripts/CheckFormatting.luau

test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Setup Rokit
uses: CompeyDev/setup-rokit@v0.1.2

- name: Install dependencies
run: wally install

- name: Run tests
run: lune run ./Scripts/RunTests.luau

analyze:
name: Static analysis
runs-on: ubuntu-latest
Expand All @@ -51,11 +94,14 @@ jobs:
- name: Setup Rokit
uses: CompeyDev/setup-rokit@v0.1.2

- name: Install dependencies
run: wally install

- name: Setup Lune typedefs
run: lune setup --no-update-luaurc

- name: Run static analysis
run: luau-lsp analyze --ignore "Source/Testable/init.luau" --platform standard .
run: luau-lsp analyze --ignore "Source/Testable/init.luau" --ignore "Submodules/**" --platform standard .

version:
name: Validate version
Expand All @@ -78,3 +124,16 @@ jobs:

- name: Check changelog entry
run: lune run ./Submodules/luau-cicd/Scripts/CheckChangelogVersion.luau

- name: Verify PR title matches VERSION
run: |
VERSION=$(cat VERSION | tr -d '[:space:]')
EXPECTED_TITLE="Release $VERSION"
ACTUAL_TITLE="${{ github.event.pull_request.title }}"

if [ "$EXPECTED_TITLE" != "$ACTUAL_TITLE" ]; then
echo "::error::PR title '$ACTUAL_TITLE' does not match VERSION file. Expected '$EXPECTED_TITLE'"
exit 1
fi

echo "PR title matches VERSION file."
26 changes: 0 additions & 26 deletions .github/workflows/test.yml

This file was deleted.