diff --git a/.github/ci.yml b/.github/ci.yml new file mode 100644 index 0000000..d187251 --- /dev/null +++ b/.github/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + pull_request: + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + fmt: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install tooling + uses: ok-nick/setup-aftman@v0.4.2 + with: + cache: true + + - name: Check formatting + run: lune run fmt src/ --check + + lint: + needs: ["fmt"] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + + - name: Install tooling + uses: ok-nick/setup-aftman@v0.4.2 + with: + cache: true + + - name: Initialize typedefs + run: lune setup + + - name: Typecheck + run: lune run typecheck + + - name: Lint + run: lune run lint diff --git a/.lune/fmt.luau b/.lune/fmt.luau index bb6e460..cbcb325 100755 --- a/.lune/fmt.luau +++ b/.lune/fmt.luau @@ -3,4 +3,9 @@ local command = require("util/command") local process = require("@lune/process") -command.run("stylua", "--verbose", process.args[1] or "src/") +command.run( + "stylua", + "--verbose", + process.args[2] or "", + process.args[1] or "src/" +) diff --git a/README.md b/README.md index 91a9d32..ffad5fc 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,4 @@ This is a template for initializing [Luau](https://luau-lang.org) projects with - Linting - Typechecking - Unit-testing setup (tests/) -- TODO -- GitHub Actions CI configuration to lints and tests (.github) -- TODO +- GitHub Actions CI configuration to lints and tests (.github)