-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9adc14e
commit 3d63096
Showing
7 changed files
with
99 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,6 @@ jobs: | |
- name: Compile | ||
run: npm run build | ||
unit-tests: | ||
if: false | ||
needs: [build] | ||
name: Unit Tests | ||
runs-on: windows-latest | ||
|
@@ -41,25 +40,13 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/[email protected] | ||
|
||
- name: Install Roblox Studio | ||
uses: OrbitalOwen/[email protected] | ||
with: | ||
cookie: ${{ secrets.ROBLOSECURITY || '_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_C4D95B1043562D1055F60AAD48C2EF833CED19A4C04639B9558E9D1CCF2AEA1718B65A404D1C553877E9E74F30A3FA55CABE3211B9496B9BBC425C8979334A9FF3C4EDE5EC33DA6A4A7CC0CDEF2FCA493B88D458EEEFC962FB1F729D01C830D98A3D0338400A0D843CDF8EFE6B42406208CA259398C6C207559D56F0429CD9D567FE6E6CCFCE3C4C87CFAC12DF8F5A0EAC7DB5E6F28D2DA7F722123DBBBA26C8339684F947C915758CC619EC51006A615C82AA087D63772D0CC59473AA35802558434770C7A0163B41E9C7E2937F51B0F8A4C0C493411B7CF470604D39B2ADEC460EDD1AB35086FC3B764770B43A8B7E6D6997AB32A0990E548E118090980192BF581C68754D39D2AC11AE2A2D7FDFC7C4CB34902CBD0B19816DC4BB023F0538C69487EAC48BEC3A7DCED3D142BE185BD103F336C24CD89EA2C3F4D3BBF8F672C922997B1CB503A2860C8F659C1661B517D1C9D7' }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install Foreman | ||
- name: Install Foreman dependencies | ||
uses: rojo-rbx/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install NPM dependencies | ||
uses: bahmutov/[email protected] | ||
|
||
- name: Compile and run tests | ||
- name: Run tests | ||
run: npm test | ||
|
||
# - name: Report Coverage | ||
# continue-on-error: true | ||
# uses: coverallsapp/[email protected] | ||
# with: | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ name: Publish | |
|
||
on: | ||
workflow_dispatch: | ||
# schedule: | ||
# - cron: "0 7 * * *" | ||
schedule: | ||
- cron: "0 7 * * *" | ||
|
||
jobs: | ||
publish: | ||
|
@@ -17,13 +17,7 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/[email protected] | ||
|
||
- name: Install Roblox Studio | ||
uses: OrbitalOwen/[email protected] | ||
with: | ||
cookie: ${{ secrets.ROBLOSECURITY || '_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_C4D95B1043562D1055F60AAD48C2EF833CED19A4C04639B9558E9D1CCF2AEA1718B65A404D1C553877E9E74F30A3FA55CABE3211B9496B9BBC425C8979334A9FF3C4EDE5EC33DA6A4A7CC0CDEF2FCA493B88D458EEEFC962FB1F729D01C830D98A3D0338400A0D843CDF8EFE6B42406208CA259398C6C207559D56F0429CD9D567FE6E6CCFCE3C4C87CFAC12DF8F5A0EAC7DB5E6F28D2DA7F722123DBBBA26C8339684F947C915758CC619EC51006A615C82AA087D63772D0CC59473AA35802558434770C7A0163B41E9C7E2937F51B0F8A4C0C493411B7CF470604D39B2ADEC460EDD1AB35086FC3B764770B43A8B7E6D6997AB32A0990E548E118090980192BF581C68754D39D2AC11AE2A2D7FDFC7C4CB34902CBD0B19816DC4BB023F0538C69487EAC48BEC3A7DCED3D142BE185BD103F336C24CD89EA2C3F4D3BBF8F672C922997B1CB503A2860C8F659C1661B517D1C9D7' }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install Foreman | ||
- name: Install Foreman dependencies | ||
uses: rojo-rbx/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[tools] | ||
rojo = {source = "rojo-rbx/rojo", version = "6.0.0-rc.1"} | ||
run-in-roblox = {source = "rojo-rbx/run-in-roblox", version = "0.3.0"} | ||
lune = { source = "filiptibell/lune", version = "0.8.8" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
-- Taken and modified from roblox-ts under the MIT license | ||
-- https://github.com/roblox-ts/roblox-ts/blob/835d1959860b45a7cdf520f7d4dd2b16a1477c94/tests/runTestsWithLune.lua | ||
|
||
local roblox = require("@lune/roblox") | ||
local fs = require("@lune/fs") | ||
local luau = require("@lune/luau") | ||
local process = require("@lune/process") | ||
|
||
local testPlacePath = process.args[1] | ||
|
||
local game = roblox.deserializePlace(fs.readFile(testPlacePath)) | ||
|
||
local function tableJoin(...) | ||
local result = {} | ||
for i = 1, select("#", ...) do | ||
for k, v in select(i, ...) do | ||
result[k] = v | ||
end | ||
end | ||
return result | ||
end | ||
|
||
-- not 100% accurate to tick() functionality, but good enough for TestEZ usage | ||
local function tick() | ||
return os.clock() | ||
end | ||
|
||
-- RuntimeLib uses :WaitForChild(), but tests don't need networking so :FindFirstChild() should be fine | ||
roblox.implementMethod("Instance", "WaitForChild", function(self, ...) | ||
return self:FindFirstChild(...) | ||
end) | ||
|
||
-- Promise.lua indexes RunService.Heartbeat, but only uses it in Promise.defer and Promise.delay | ||
roblox.implementProperty("RunService", "Heartbeat", function() | ||
return {} | ||
end, function() end) | ||
|
||
local robloxRequire | ||
|
||
local function runRobloxScript(script: LuaSourceContainer) | ||
local callableFn = luau.load(luau.compile(script.Source), { | ||
debugName = script:GetFullName(), | ||
environment = tableJoin(roblox, { | ||
game = game, | ||
script = script, | ||
require = robloxRequire, | ||
tick = tick, | ||
}), | ||
}) | ||
|
||
return callableFn() | ||
end | ||
|
||
local requireCache = {} | ||
|
||
function robloxRequire(moduleScript: ModuleScript) | ||
-- the same script instance sometimes gives a different ref | ||
-- unsure why, but using :GetFullName() fixes this for now | ||
local scriptPath = moduleScript:GetFullName() | ||
local cached = requireCache[scriptPath] | ||
if cached then | ||
return table.unpack(cached) | ||
end | ||
|
||
local result = table.pack(runRobloxScript(moduleScript)) | ||
requireCache[scriptPath] = result | ||
return table.unpack(result) | ||
end | ||
|
||
runRobloxScript(game.ServerScriptService.main) |