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
124 changes: 124 additions & 0 deletions .github/workflows/run-luau-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Run Luau tests

on:
workflow_dispatch:
push:
branches:
- production
paths:
- "src/**"
- "pesde.toml"
- "development.project.json"
- ".github/workflows/run-luau-tests.yml"
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- "src/**"
- "pesde.toml"
- "development.project.json"
- ".github/workflows/run-luau-tests.yml"

concurrency:
group: ${{ github.workflow }}

jobs:
build:
if: ${{ !github.event.pull_request.draft }}
name: Build testing place
runs-on: ubuntu-24.04
timeout-minutes: 1
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
submodules: recursive

- name: Set up pesde
uses: ernisto/setup-pesde@5f9a3399d5ae0fe78b014f5f13cd913f27755fb4
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: pesde install

- name: Build Rojo project
run: rojo build development.project.json -o build.rbxl

- name: Upload project
uses: actions/[email protected]
with:
name: build.rbxl
path: build.rbxl

publish:
name: Deploy testing place to Roblox
runs-on: ubuntu-24.04
timeout-minutes: 1
needs: build
steps:
- name: Download project
uses: actions/[email protected]
with:
name: build.rbxl

- name: POST to Roblox API
env:
ROBLOX_API_KEY: ${{ secrets.ROBLOX_DEPLOYMENT_API_KEY }}
ROBLOX_UNIVERSE_ID: ${{ vars.ROBLOX_UNIVERSE_ID }}
ROBLOX_PLACE_ID: ${{ vars.ROBLOX_PLACE_ID }}
run: |
curl \
--fail-with-body \
-H "x-api-key: $ROBLOX_API_KEY" \
-H "Content-Type: application/xml" \
--data-binary @build.rbxl \
"https://apis.roblox.com/universes/v1/""$ROBLOX_UNIVERSE_ID""/places/""$ROBLOX_PLACE_ID""/versions?versionType=Published"

test:
runs-on: ubuntu-24.04
name: Run test cases
timeout-minutes: 1
needs: publish
steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Execute script
uses: grand-hawk/[email protected]
with:
roblox_api_key: ${{ secrets.ROBLOX_DEPLOYMENT_API_KEY }}
universe_id: ${{ vars.ROBLOX_UNIVERSE_ID }}
place_id: ${{ vars.ROBLOX_PLACE_ID }}
luau_file: "runTests.luau"
output_file: "testResults.json"
dump_to_summary: true

- name: Verify all tests passed
uses: actions/github-script@v7
with:
script: |
try {

const outputFile = require("./testResults.json");
const testResults = outputFile[0];
if (!testResults) {

throw new Error("No test results found.");

}

for (const test of testResults) {

if (!test.didPass) {

throw new Error("A test case failed.");

}

}

} catch (error) {

core.setFailed(error);

}
2 changes: 1 addition & 1 deletion default.project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "DialoguePluginScript",
"name": "DialoguePlugDialogueMakerPlugininScript",
"tree": {
"$path": "src",
"roblox_packages": {
Expand Down
4 changes: 2 additions & 2 deletions development.project.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "DialoguePluginScript",
"name": "DialogueMakerPlugin",
"tree": {
"$className": "DataModel",
"ServerStorage": {
"DialoguePluginScript": {
"DialogueMakerPlugin": {
"$path": "src",
"roblox_packages": {
"$path": "roblox_packages"
Expand Down
12 changes: 12 additions & 0 deletions pesde.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ frktest = [{ name = "itsfrank/frktest", version = "^0.0.2", index = "https://git
luau-lsp = [{ name = "pesde/luau_lsp", version = "=1.39.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
stylua = [{ name = "pesde/stylua", version = "=2.0.2", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]

[graph."beastslash/[email protected] roblox"]
direct = ["ijw", { name = "beastslash/ijw", version = "^1.1.2", index = "default" }, "dev"]

[graph."beastslash/[email protected] roblox".pkg_ref]
ref_ty = "pesde"
index_url = "https://github.com/pesde-pkg/index"

[graph."beastslash/[email protected] roblox".pkg_ref.dependencies]
luau_lsp = [{ name = "pesde/luau_lsp", version = "^1.47.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
rojo = [{ name = "pesde/rojo", version = "^7.4.4", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]
scripts = [{ name = "pesde/scripts_rojo", version = "^0.1.0", index = "https://github.com/pesde-pkg/index", target = "lune" }, "dev"]

[graph."corecii/[email protected] lune".pkg_ref]
ref_ty = "pesde"
index_url = "https://github.com/daimond113/pesde-index"
Expand Down
7 changes: 4 additions & 3 deletions pesde.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ includes = [
"pesde.toml",
"README.md",
"LICENSE",
"src/**/*.lua",
"src/**/*.luau",
]
workspace_members = ["src/DialogueMakerKit"]
private = true

[target]
environment = "roblox"
lib = "src/init.lua"
lib = "src/init.luau"
build_files = ["src"]

[engines]
pesde = "^0.7.0-rc.3"
pesde = "^0.7.0-rc.6"
lune = "^0.8.9"

[indices]
Expand All @@ -36,6 +36,7 @@ sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau"
scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" }
rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" }
luau_lsp = { name = "pesde/luau_lsp", version = "^1.47.0", target = "lune" }
ijw = { name = "beastslash/ijw", version = "^1.1.2" }

[dependencies]
react = { wally = "jsdotlua/react", version = "^17.2.1" }
Expand Down
13 changes: 13 additions & 0 deletions runTests.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--!strict

local ServerStorage = game:GetService("ServerStorage");

local IJW = require(ServerStorage.DialogueMakerPlugin.roblox_packages.ijw);
local TestRunner = IJW.TestRunner;

local tests = TestRunner:findTestsFromAncestors({ServerStorage.DialogueMakerPlugin:Clone()}, ".test");
local results = TestRunner:runTests(tests);

TestRunner:displayResults(results);

return results;
Loading