Add GitHub Actions setup for continuous integration

This commit is contained in:
Erica Marigold 2024-07-08 16:49:02 +05:30
parent 1397b6c289
commit 3e194e2a98
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1
3 changed files with 55 additions and 2 deletions

48
.github/ci.yml vendored Normal file
View file

@ -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

View file

@ -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/"
)

View file

@ -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)