-
-
Notifications
You must be signed in to change notification settings - Fork 180
59 lines (52 loc) · 1.53 KB
/
lint.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
name: lint
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ok-nick/[email protected]
with:
token: ${{ SECRETS.GITHUB_TOKEN }}
- name: Cache Roblox Standard Library
id: cache-roblox-std
uses: actions/[email protected]
with:
path: roblox.yml
key: roblox-std
- name: Check standard roblox library status
id: check-roblox-std
env:
DID_CACHE: ${{steps.cache-roblox-std.outputs.cache-hit}}
run: |
if test -f roblox.yml; then
CUR_ROBLOX_STD_TIMEDATE="$(date +%s -d "$(cat roblox.yml | head -n 1 | grep -oP "\d{4}-\d{2}-\d{2}(?=\s+\d{2}:\d{2}:\d{2})")")"
else
CUR_ROBLOX_STD_TIMEDATE=0
fi
if [ "$DID_CACHE" == "true" ]
then
if [ "$(($(date +%s)-$CUR_ROBLOX_STD_TIMEDATE))" -ge "604800" ]
then
echo "::notice ::Roblox Standard Library Cache is out of date by 1 week, requiring a refresh of the standard library cache."
echo "should-fetch=true" >> $GITHUB_OUTPUT
else
echo "should-fetch=false" >> $GITHUB_OUTPUT
fi
else
echo "should-fetch=true" >> $GITHUB_OUTPUT
fi
- name: Update standard roblox library
if: steps.check-roblox-std.outputs.should-fetch == 'true'
run: |
selene generate-roblox-std
- name: Lint
run: |
selene ./MainModule ./Loader