diff --git a/.github/workflows/go.yml b/.github/workflows/build.yml similarity index 95% rename from .github/workflows/go.yml rename to .github/workflows/build.yml index 09eb454..38fce31 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,9 @@ name: Test and build Docker image -on: [push, pull_request] +on: + push: + branches: + - master jobs: build: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6cce768 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: Run tests + +on: [pull_request] + +jobs: + build: + name: Run tests + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.14 + uses: actions/setup-go@v1 + with: + go-version: 1.14 + id: go + - name: Check out code + uses: actions/checkout@v2 + - name: Test + run: go test -v ./... \ No newline at end of file diff --git a/server.go b/server.go index 23b4ef2..1d49cb2 100644 --- a/server.go +++ b/server.go @@ -45,7 +45,7 @@ func handler(crucibleSettings CrucibleSettings, gitLabSettings GitLabSettings, c return } - err = TriggerCrucibleSync(projectId, client, crucibleSettings) + err = TriggerCrucibleSync(projectId, client, &crucibleSettings) if err != nil { log.Printf("error when sending request to Crucible: %s\n", err.Error()) http.Error(w, err.Error(), http.StatusInternalServerError)