-
Notifications
You must be signed in to change notification settings - Fork 7
208 lines (165 loc) · 5.72 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Roblox/setup-foreman@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Lint
run: |
selene generate-roblox-std
selene src/
- name: Format
run: stylua --check src/
- name: Install dependencies
run: wally install
- name: Get model file name
run: |
name=$(jq -r .name default.project.json)
sha=${GITHUB_SHA:0:7}
echo "MODEL_FILE=$name-$sha.rbxm" >> $GITHUB_ENV
- name: Build
run: rojo build -o ${{ env.MODEL_FILE }}
- uses: actions/upload-artifact@v3
with:
name: ${{ env.MODEL_FILE }}
path: ${{ env.MODEL_FILE }}
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Roblox/setup-foreman@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: wally install
- name: Download global Roblox types
shell: bash
run: curl -s -O https://raw.githubusercontent.com/JohnnyMorganz/luau-lsp/master/scripts/globalTypes.d.lua
- name: Generate sourcemap for LSP
shell: bash
run: rojo sourcemap dev.project.json -o sourcemap.json
- name: Analyze
shell: bash
run: luau-lsp analyze --sourcemap=sourcemap.json --defs=globalTypes.d.lua --defs=testez.d.lua --ignore=**/_Index/** src/
scripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Ensure each script is executable
run: |
for f in ./bin/*; do
if [[ ! -x "$f" ]]; then
echo "Script '$f' is not executable"
exit 1
fi
done
tests:
runs-on: windows-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Check for ROBLOSECURITY secret
shell: bash
run: ./.github/workflows/validate-secret.sh ROBLOSECURITY "${{ secrets.ROBLOSECURITY }}"
- name: Check for MULLVAD_ACCOUNT secret
shell: bash
run: ./.github/workflows/validate-secret.sh MULLVAD_ACCOUNT "${{ secrets.MULLVAD_ACCOUNT }}"
- uses: Roblox/setup-foreman@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: wally install
- name: Build place file
run: rojo build dev.project.json -o studio-tests.rbxl
- name: Install Mullvad
shell: bash
run: |
curl -O https://github.com/mullvad/mullvadvpn-app/releases/download/2023.5/MullvadVPN-2023.5.exe
./MullvadVPN-2023.5.exe
- name: Update path with Mullvad executable
shell: bash
run: |
BIN="/c/Program Files/Mullvad VPN/resources"
echo "$BIN" >> $GITHUB_PATH
- name: Login to Mullvad account
shell: bash
run: mullvad account login ${{ secrets.MULLVAD_ACCOUNT }}
- name: Set server to connect to
shell: bash
run: mullvad relay set location us-sjc-wg-001
- name: Export IP before connecting to VPN
shell: bash
run: |
ip=$(curl -s https://httpbin.org/ip | jq -r .origin)
echo "Current IP address: $ip"
echo "RUNNER_IP=$ip" >> $GITHUB_ENV
- name: Connect to VPN
shell: bash
run: mullvad connect
- name: Export device name
shell: bash
run: |
deviceName=$(mullvad account get | grep "Device name" | cut -d : -f 2 | xargs)
echo "Device name: $deviceName"
echo "DEVICE_NAME=$deviceName" >> $GITHUB_ENV
- name: Poll for IP change
uses: nick-fields/[email protected]
with:
max_attempts: 5
timeout_minutes: 2
retry_wait_seconds: 2
shell: bash
command: |
ip=$(curl -s https://httpbin.org/ip | jq -r .origin)
echo "Original IP: ${{ env.RUNNER_IP }}"
echo "Current IP: $ip"
if [[ $ip != "" && "${{ env.RUNNER_IP }}" != "$ip" ]]; then
echo "IP changed, assuming we're connected now to the VPN"
exit 0
else
echo "IP has not changed yet. Retrying...."
exit 1
fi
- name: Log Mullvad status
shell: bash
run: mullvad status -v
- name: List tokens
shell: bash
run: cmdkey /list:"LegacyGeneric:target=https://www.roblox.com:RobloxStudioAuth*"
- name: Set .ROBLOSECURITY token
shell: bash
run: cmdkey /generic:"LegacyGeneric:target=https://www.roblox.com:RobloxStudioAuth.ROBLOSECURITY" /user:"Roblox" /pass:"${{ secrets.ROBLOSECURITY }}"
- name: List tokens
shell: bash
run: cmdkey /list:"LegacyGeneric:target=https://www.roblox.com:RobloxStudioAuth*"
- uses: actions/checkout@v3
with:
repository: vocksel/roblox-win-installer
path: roblox-win-installer
- name: Install Roblox Studio
shell: bash
run: |
cd roblox-win-installer
pip install --requirement requirements.txt;
python install.py "${{ secrets.ROBLOSECURITY }}"
- name: Run tests
run: run-in-roblox --place studio-tests.rbxl --script tests/init.server.lua
- name: Disconnect from VPN
if: always()
shell: bash
run: |
mullvad disconnect
mullvad account revoke-device "${{ env.DEVICE_NAME }}"
- name: Screenshot
if: failure()
uses: OrbitalOwen/[email protected]
with:
file-name: 'roblox-studio-${{ github.run_id }}.jpg'