Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Fusion's CI Workflow #223

Merged
merged 4 commits into from
Feb 6, 2023
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
95 changes: 3 additions & 92 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
name: CI

on:
pull_request:
push:

env:
ROBLOSECURITY: ${{ secrets.ROBLOSECURITY || '_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_F197F1B95A448B8B2DEA5DC398DB75C2ED1D73C44EF0380BEB5F1752D8C002027BFF436577C6D57F4137242491CD603999DB702C5FFC7E029FB39125158EA3571116A36B94D8EC1C4CA4E17BC2FA7D284DECA5441CA3327565B2261EF20DA0CBBA5DE000320BF1FF01166003B8EC6831BAD3AFF07D81D3350BA16DC5474C85A31F3E78FBDE8DAF1285922CD0306DA3C55A37E122CB83029AC933B3C997C27F3B1CAD7A593D9153EA1F0A65DCF4DD5E5EA7F0C485E4465F9F69282EAA3D223AB75E2304F6E08AFB74482C4F6FC5DFA680D8C6F7E96C4177612B6F763C4DB869FD8870700493F50006494253E2EE16424C1104FEE364856165B33E3CECEE9096C8266E5BCD575E4E7BAC282A3B0BA3772125A4B2027262E826BE2E05FA0F34E6F9568FC85E69ECFFDCBBF74852A38D43468CEC6FE45BACB6892A857298E66438AE7A6C2BFA8B9BC84B0B4DB94DC14C051C6AA199ACF783409E978C17E6DD3E5D622548FA3CED793C9C78F6235DF09A689D272B1B71CB98AC589F9C03B0950A9C9A9E8C6F35' }}
branches:
main

jobs:
lint:
Expand All @@ -23,91 +21,4 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Selene
run: selene src test benchmark
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Run StyLua check
uses: JohnnyMorganz/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --check src test benchmark
unit-tests:
name: Unit Tests
runs-on: windows-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Install Foreman
uses: rojo-rbx/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Build test place
run: rojo build test-runner.project.json -o test.rbxl

- name: Download OpenVPN
run: choco install openvpn

- name: Run OpenVPN
run: Start-Process -FilePath "C:\\Program Files\\OpenVPN\\bin\\openvpn.exe" -ArgumentList "--config $((Resolve-Path .\\fusion.ovpn).Path)"

- name: Poll for IP Change
run: |
$elapsed = 0
while ($true) {
try {
$response = Invoke-WebRequest -Uri 'https://httpbin.org/ip' -Method GET -UseBasicParsing
$content = ConvertFrom-Json $response.Content
if ($content.origin -eq "104.238.130.74") {
break
}
} catch {}
if ($elapsed -ge 25) {
Write-Error "Timeout reached!"
exit 1
}
Write-Output "Polling.. Elasped: $elapsed, IP: $($content.origin)"
Start-Sleep 5
$elapsed += 5
}
Write-Output "Success!"

- name: Validate Cookie
run: |
$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$cookie = New-Object System.Net.Cookie
$cookie.Name = ".ROBLOSECURITY"
$cookie.Value = "${{ env.ROBLOSECURITY }}"
$cookie.Domain = ".roblox.com"
$session.Cookies.Add($cookie);
Invoke-WebRequest "https://avatar.roblox.com/v1/avatar" -WebSession $session -UseBasicParsing

- name: Install Roblox Studio
uses: OrbitalOwen/[email protected]
with:
# This cookie is intentionally public, because secrets are not available in pull request CI runs
# It is from an empty account and not a security vulnerability
cookie: ${{ env.ROBLOSECURITY }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
shell: bash
run: run-in-roblox --place test.rbxl --script test-runner/Run.client.lua > test-out.txt
continue-on-error: true

- name: Screenshot
if: failure()
uses: OrbitalOwen/[email protected]
with:
file-name: 'desktop.jpg'

- name: Check test status
shell: bash
run: cat test-out.txt | grep "0 failed, 0 skipped" || (cat test-out.txt && exit 1)
run: selene src test benchmark
2 changes: 1 addition & 1 deletion foreman.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[tools]
rojo = { source = "rojo-rbx/rojo", version = "6.2.0" }
run-in-roblox = {source = "rojo-rbx/run-in-roblox", version = "0.3.0"}
selene = { source = "Kampfkarren/selene", version = "0.15.0" }
selene = { source = "Kampfkarren/selene", version = "0.24.0" }