File tree 4 files changed +74
-1
lines changed
4 files changed +74
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : integration
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ paths-ignore :
8
+ - docs/**
9
+ - tools/**
10
+ - README.md
11
+ pull_request :
12
+ branches :
13
+ - main
14
+ paths-ignore :
15
+ - docs/**
16
+ - tools/**
17
+ - README.md
18
+
19
+ jobs :
20
+ integration :
21
+ runs-on : ${{ matrix.os }}
22
+ strategy :
23
+ matrix :
24
+ os : [ubuntu-22.04, windows-latest]
25
+ steps :
26
+ - uses : actions/checkout@v4
27
+ with :
28
+ fetch-depth : 1
29
+ - uses : actions/setup-go@v5
30
+ with :
31
+ cache : false
32
+ go-version : " 1.22"
33
+ - name : Build
34
+ if : matrix.os == 'ubuntu-22.04'
35
+ run : make build
36
+ - name : build-windows
37
+ if : matrix.os == 'windows-latest'
38
+ run : make build-exe
39
+ - name : Run Integration Tests
40
+ run : make integration
Original file line number Diff line number Diff line change 12
12
go mod tidy
13
13
14
14
test :
15
- go test -v ./...
15
+ go test -v ./pkg/...
16
+
17
+ .PHONY : integration
18
+ integration :
19
+ go test -v ./integration/...
16
20
17
21
smoke : build
18
22
smoke :
Original file line number Diff line number Diff line change
1
+ package integration
2
+
3
+ import (
4
+ "testing"
5
+
6
+ "github.com/stretchr/testify/require"
7
+ )
8
+
9
+ func TestGPTScriptCredential (t * testing.T ) {
10
+ out , err := GPTScriptExec ("cred" )
11
+ require .NoError (t , err )
12
+ require .Contains (t , out , "CREDENTIAL" )
13
+ }
Original file line number Diff line number Diff line change
1
+ package integration
2
+
3
+ import (
4
+ "os/exec"
5
+ "runtime"
6
+ )
7
+
8
+ func GPTScriptExec (args ... string ) (string , error ) {
9
+ cmd := exec .Command ("../bin/gptscript" , args ... )
10
+ if runtime .GOOS == "windows" {
11
+ cmd = exec .Command ("..\\ bin\\ gptscript.exe" , args ... )
12
+ }
13
+
14
+ out , err := cmd .CombinedOutput ()
15
+ return string (out ), err
16
+ }
You can’t perform that action at this time.
0 commit comments