-
Notifications
You must be signed in to change notification settings - Fork 9
80 lines (77 loc) · 2.18 KB
/
test.yaml
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
name: test
on:
push:
branches:
- main
paths-ignore:
- README.md
pull_request_target:
types:
- labeled
- unlabeled
branches:
- main
paths-ignore:
- README.md
jobs:
check-perms:
runs-on: ubuntu-latest
steps:
- name: Get User Permission
id: checkAccess
uses: actions-cool/check-user-permission@v2
with:
require: write
username: ${{ github.triggering_actor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check User Permission
if: steps.checkAccess.outputs.require-result == 'false'
run: |
echo "${{ github.triggering_actor }} does not have permissions on this repo."
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
echo "Job originally triggered by ${{ github.actor }}"
exit 1
test-linux:
needs: check-perms
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-go@v5
with:
cache: false
go-version: "1.22"
- name: Validate
run: make validate
- name: Install gptscript
run: |
curl https://get.gptscript.ai/releases/default_linux_amd64_v1/gptscript -o ./gptscriptexe
chmod +x ./gptscriptexe
- name: Run Tests
env:
GPTSCRIPT_BIN: ./gptscriptexe
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: make test
test-windows:
needs: check-perms
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-go@v5
with:
cache: false
go-version: "1.22"
- name: Install gptscript
run: |
curl https://get.gptscript.ai/releases/default_windows_amd64_v1/gptscript.exe -o gptscript.exe
- name: Run Tests
env:
GPTSCRIPT_BIN: .\gptscript.exe
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: make test