diff options
author | Andy Zhao <andyzhao@google.com> | 2022-05-18 13:37:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-18 13:37:31 -0700 |
commit | 7798faac1fcac5da00cc0e8b304e938bdab7b20e (patch) | |
tree | db3bf1ac39d58b1cca3ab9d332b3ccc4058f507f | |
parent | c078f23f9766e793372810c5db67fee904b9e864 (diff) | |
download | googleapis-enterprise-certificate-proxy-7798faac1fcac5da00cc0e8b304e938bdab7b20e.tar.gz |
Configure Github CI tests for client, cshared, and signer/darwin (#12)
-rw-r--r-- | .github/workflows/test-client.yml | 25 | ||||
-rw-r--r-- | .github/workflows/test-cshared.yml | 25 | ||||
-rw-r--r-- | .github/workflows/test-signer-darwin.yml | 27 | ||||
-rw-r--r-- | cshared/main.go | 2 | ||||
-rw-r--r-- | internal/signer/darwin/keychain/keychain_test.go | 2 |
5 files changed, 78 insertions, 3 deletions
diff --git a/.github/workflows/test-client.yml b/.github/workflows/test-client.yml new file mode 100644 index 0000000..ba2703d --- /dev/null +++ b/.github/workflows/test-client.yml @@ -0,0 +1,25 @@ +name: Build and Test Client + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + + - name: Build + run: go build -v ./client/... + + - name: Test + run: go test -v ./client/... diff --git a/.github/workflows/test-cshared.yml b/.github/workflows/test-cshared.yml new file mode 100644 index 0000000..4a6b041 --- /dev/null +++ b/.github/workflows/test-cshared.yml @@ -0,0 +1,25 @@ +name: Build and Test C-Shared Library + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + + - name: Build + run: go build -buildmode=c-shared -v -o signer.so ./cshared/... + + - name: Test + run: go test -v ./cshared/... diff --git a/.github/workflows/test-signer-darwin.yml b/.github/workflows/test-signer-darwin.yml new file mode 100644 index 0000000..2748803 --- /dev/null +++ b/.github/workflows/test-signer-darwin.yml @@ -0,0 +1,27 @@ +name: Build and Test Signer Darwin + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + + - name: Build + working-directory: ./internal/signer/darwin + run: go build -v ./... + + - name: Test + working-directory: ./internal/signer/darwin + run: go test -v ./... diff --git a/cshared/main.go b/cshared/main.go index a5fc172..e34bf8d 100644 --- a/cshared/main.go +++ b/cshared/main.go @@ -109,7 +109,7 @@ func SignForPython(configFilePath *C.char, digest *byte, digestLen int, sigHolde // Create a Go buffer around the output buffer and copy the signature into the buffer outBytes := unsafe.Slice(sigHolder, sigHolderLen) if sigHolderLen < len(signature) { - log.Print("The sigHolder buffer size %d is smaller than the signature size %d", sigHolderLen, len(signature)) + log.Printf("The sigHolder buffer size %d is smaller than the signature size %d", sigHolderLen, len(signature)) return 0 } for i := 0; i < len(signature); i++ { diff --git a/internal/signer/darwin/keychain/keychain_test.go b/internal/signer/darwin/keychain/keychain_test.go index 37df835..f6918a7 100644 --- a/internal/signer/darwin/keychain/keychain_test.go +++ b/internal/signer/darwin/keychain/keychain_test.go @@ -6,8 +6,6 @@ package keychain import ( "bytes" "crypto" - "crypto/rsa" - "crypto/sha256" "testing" "unsafe" ) |