From 58d5214f7a2298ef44d07c5d969258576316a49c Mon Sep 17 00:00:00 2001 From: Jason Johnston Date: Tue, 17 Oct 2023 16:50:18 -0400 Subject: [PATCH 1/3] Create go.yml Add workflow to run go tests on PRs --- .github/workflows/go.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000..721954ef --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,29 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Go + +on: + push: + branches: [ "trunk" ] + pull_request: + branches: [ "trunk" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies + run: | + go get . + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Test + run: go test -v ./... From 72d99e8ac02ec651f59c696cdf331492bdacdaf6 Mon Sep 17 00:00:00 2001 From: Jason Johnston Date: Tue, 17 Oct 2023 16:51:45 -0400 Subject: [PATCH 2/3] Update go.yml Fix path to cli --- .github/workflows/go.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 721954ef..3bf806a1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -18,6 +18,7 @@ jobs: - name: Install dependencies run: | + cd ./cli go get . - name: Set up Go @@ -26,4 +27,6 @@ jobs: go-version: '1.21' - name: Test - run: go test -v ./... + run: | + cd cli + go test -v ./... From 49bcc25e0ba662e6d212e9025b4738a9522b9950 Mon Sep 17 00:00:00 2001 From: Jason Johnston Date: Tue, 17 Oct 2023 16:54:39 -0400 Subject: [PATCH 3/3] Update go.yml Install dependencies after setting up the go version --- .github/workflows/go.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3bf806a1..56cd7574 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,15 +16,15 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install dependencies - run: | - cd ./cli - go get . - - name: Set up Go uses: actions/setup-go@v4 with: go-version: '1.21' + + - name: Install dependencies + run: | + cd ./cli + go get . - name: Test run: |