-
-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (30 loc) · 1.03 KB
/
pr.yml
File metadata and controls
37 lines (30 loc) · 1.03 KB
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
name: PR
on:
pull_request:
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: leafo/gh-actions-lua@8c9e175e7a3d77e21f809eefbee34a19b858641b
with:
luaVersion: 5.4
- uses: leafo/gh-actions-luarocks@97053c556d6ce2c8e26eb7ac93743437c7af7248
- name: build
run: |
luarocks install busted
luarocks install moonscript
luarocks install lua-tz
- name: Run tests for changed/added exercises
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pr_endpoint=$(jq -r '"repos/\(.repository.full_name)/pulls/\(.pull_request.number)"' "$GITHUB_EVENT_PATH")
gh api "$pr_endpoint/files" --paginate --jq '
map(
.filename
| select(match("\\.moon$"))
| match("exercises/practice/([^/]+)/")
| .captures[0].string
) | unique[]
' | xargs -r -L1 bin/verify-exercises