Skip to content

Commit 89087cf

Browse files
authored
ci: Add luau-lsp type checking github action and integration (#545)
ci: Add luau-lsp type checking github action and integration
2 parents e8ea569 + 2374fb2 commit 89087cf

File tree

684 files changed

+13659
-8943
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

684 files changed

+13659
-8943
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
uses: ./.github/workflows/lint.yml
66

77
release:
8-
needs: lint
8+
needs: [lint]
99
runs-on: ubuntu-latest
1010
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
1111
steps:
@@ -38,6 +38,16 @@ jobs:
3838
run: npm run build
3939
working-directory: tools/nevermore-template-helpers
4040

41+
- name: Setup npm for GitHub Packages
42+
run: |
43+
echo -e "\n//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> .npmrc
44+
echo -e "\n//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ~/.npmrc
45+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
46+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
50+
4151
- name: Run `npm install --no-package-lock` on nevermore-cli
4252
run: npm install --no-package-lock
4353
working-directory: tools/nevermore-cli
@@ -49,6 +59,9 @@ jobs:
4959
- name: Run npm install
5060
run: npm install --no-save
5161

62+
- name: Git reset .npmrc
63+
run: git checkout .npmrc
64+
5265
- name: Create Release
5366
env:
5467
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint-external-prs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ on: [pull_request_target]
55
jobs:
66
lint:
77
if: "github.event.pull_request.head.repo.fork"
8-
uses: ./.github/workflows/lint.yml
8+
uses: ./.github/workflows/lint.yml

.github/workflows/lint.yml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,39 @@
1-
# Reusable workflow that lints the repository!
21
name: lint
32
on:
43
workflow_call
54
jobs:
6-
lint:
5+
luau-lsp:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout repository
9+
uses: actions/checkout@v2
10+
11+
- name: Setup Aftman
12+
uses: ok-nick/setup-aftman@v0.4.2
13+
with:
14+
version: 'v0.3.0'
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
17+
- name: Setup npm for GitHub Packages
18+
run: |
19+
echo -e "\n//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> .npmrc
20+
echo -e "\n//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ~/.npmrc
21+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
22+
echo -e "\n//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26+
27+
- name: Link and install packages
28+
run: npm run build:link
29+
30+
- name: Generate Sourcemap
31+
run: npm run build:sourcemap
32+
33+
- name: luau-lsp analyze
34+
run: npm run lint:luau
35+
36+
selene:
737
runs-on: ubuntu-latest
838
steps:
939
- name: Checkout repository
@@ -21,6 +51,17 @@ jobs:
2151
- name: Run Selene
2252
run: selene src
2353

54+
moonwave:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v2
59+
60+
- name: Setup Aftman
61+
uses: ok-nick/setup-aftman@v0.4.2
62+
with:
63+
version: 'v0.3.0'
64+
token: ${{ secrets.GITHUB_TOKEN }}
65+
2466
- name: Run moonwave-extractor
25-
if: success() || failure()
2667
run: moonwave-extractor extract src

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ sourcemap.json
1010
dist
1111
*.tsbuildinfo
1212
.DS_Store
13+
globalTypes.d.lua
1314

1415
# Normally it's a good idea to commit this. However, in this mono-repo scenario with linking
1516
# it adds a ton of noise and no real gain. Also we have seen no gains from reproducing

.luaurc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"languageMode": "strict",
3-
"lint": { "*": true },
4-
"lintErrors": true,
5-
"typeErrors": true,
6-
"globals": []
2+
"languageMode": "nonstrict",
3+
"lintErrors": true,
4+
"lint": {
5+
"*": true
6+
}
77
}

.vscode/extensions.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"recommendations": [
3-
"kampfkarren.selene-vscode",
4-
"nightrains.robloxlsp",
5-
"shardulm94.trailing-spaces"
3+
"kampfkarren.selene-vscode",
4+
"johnnymorganz.luau-lsp",
5+
"johnnymorganz.stylua",
6+
"shardulm94.trailing-spaces",
7+
"esbenp.prettier-vscode"
68
]
79
}

.vscode/settings.json

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
{
2-
"files.exclude": {
3-
"*.sublime-workspace": true,
4-
"node_modules": true,
5-
"out": true,
6-
"roblox.toml": true
7-
},
8-
"Lua.diagnostics.enable": false,
9-
"files.trimTrailingWhitespace": true
2+
"files.exclude": {
3+
"*.sublime-workspace": true,
4+
"node_modules": true,
5+
"out": true,
6+
"roblox.toml": true
7+
},
8+
"luau-lsp.server.path": "/Users/jonnen/.aftman/bin/luau-lsp",
9+
"luau-lsp.ignoreGlobs": ["**/node_modules/**"],
10+
"luau-lsp.fflags.enableNewSolver": false,
11+
"[lua]": {
12+
"editor.defaultFormatter": "JohnnyMorganz.stylua",
13+
"editor.formatOnSave": true,
14+
"editor.formatOnSaveMode": "file"
15+
},
16+
"[typescript]": {
17+
"editor.defaultFormatter": "esbenp.prettier-vscode",
18+
"editor.formatOnSave": true,
19+
"editor.formatOnSaveMode": "file"
20+
},
21+
"files.trimTrailingWhitespace": true
1022
}

aftman.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33

44
# To add a new tool, add an entry to this table.
55
[tools]
6+
luau-lsp = "Quenty/luau-lsp@1.42.0-quenty.1"
7+
lune = "lune-org/lune@0.8.9"
8+
mantle = "blake-mealey/mantle@0.10.7"
9+
moonwave-extractor = "UpliftGames/moonwave@1.3.0"
10+
remodel = "rojo-rbx/remodel@0.9.1"
611
rojo = "quenty/rojo@7.4.3-quenty-npm-canary.2"
712
run-in-roblox = "rojo-rbx/run-in-roblox@0.3.0"
813
selene = "Kampfkarren/selene@0.28.0"
9-
moonwave-extractor = "UpliftGames/moonwave@1.3.0"
10-
mantle = "blake-mealey/mantle@0.10.7"
11-
remodel = "rojo-rbx/remodel@0.9.1"
12-
luau-lsp = "JohnnyMorganz/luau-lsp@1.27.1"
13-
lune = "lune-org/lune@0.8.9"
14-
run-in-roblox = "rojo-rbx/run-in-roblox@0.3.0"

docs/servicebag.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ something like this:
187187
```lua
188188
local OtherService = require("OtherService")
189189

190-
function ServiceName:Init(serviceBag)
190+
function ServiceName:Init(serviceBag: ServiceBag.ServiceBag)
191191
assert(not self._serviceBag, "Already initialized")
192192

193193
self._serviceBag = assert(serviceBag, "No serviceBag")

games/integration/modules/Client/Button/LookAtButtonsClient.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function LookAtButtonsClient:_setupLocal()
4747
self:_stopTrackingPhysicalButton(physicalButton)
4848
end))
4949

50-
for _, physicalButton in pairs(self._gameBindersClient.PhysicalButton:GetAll()) do
50+
for _, physicalButton in self._gameBindersClient.PhysicalButton:GetAll() do
5151
self:_trackPhysicalButton(physicalButton)
5252
end
5353

0 commit comments

Comments
 (0)