From 3578d76566e5a4be343b4d8c9a8daef24ce9b043 Mon Sep 17 00:00:00 2001 From: Nathan <148575555+nathan-artie@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:27:00 -0700 Subject: [PATCH 1/8] github: run tests just once --- .github/workflows/gha-go-test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/gha-go-test.yml b/.github/workflows/gha-go-test.yml index 7106a8f00..d1b821474 100644 --- a/.github/workflows/gha-go-test.yml +++ b/.github/workflows/gha-go-test.yml @@ -20,9 +20,7 @@ jobs: make static - name: Run vet run: make vet - - name: Run tests - run: make test - - name: Run race condition check + - name: Run tests + race condition check run: make race - name: Check Go files are properly formatted run: test -z $(gofmt -l .) From 127211ec23d1f095f0db9fcad693f94cc5b8c06e Mon Sep 17 00:00:00 2001 From: Nathan <148575555+nathan-artie@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:28:35 -0700 Subject: [PATCH 2/8] Bump staticcheck --- .github/workflows/gha-go-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gha-go-test.yml b/.github/workflows/gha-go-test.yml index d1b821474..1ff85f2c6 100644 --- a/.github/workflows/gha-go-test.yml +++ b/.github/workflows/gha-go-test.yml @@ -12,7 +12,7 @@ jobs: go-version: 1.23 - name: Run staticcheck env: - SC_VERSION: "2024.1" + SC_VERSION: "2024.1.1" run: | make generate SC_URL="https://github.com/dominikh/go-tools/releases/download/$SC_VERSION/staticcheck_linux_amd64.tar.gz" From 76b2118638265b1b5fb1352d260f2ea484765155 Mon Sep 17 00:00:00 2001 From: Nathan <148575555+nathan-artie@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:12:14 -0700 Subject: [PATCH 3/8] github: add step to install Go dependencies --- .github/workflows/gha-go-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gha-go-test.yml b/.github/workflows/gha-go-test.yml index 1ff85f2c6..161c47042 100644 --- a/.github/workflows/gha-go-test.yml +++ b/.github/workflows/gha-go-test.yml @@ -1,6 +1,7 @@ name: Go tests -run-name: Running tests + on: [push] + jobs: test: runs-on: ubuntu-latest @@ -10,6 +11,8 @@ jobs: uses: actions/setup-go@v5 with: go-version: 1.23 + - name: Install dependencies + run: go mod download - name: Run staticcheck env: SC_VERSION: "2024.1.1" From 391743b163f78a25deb560dc7e67805e778342a1 Mon Sep 17 00:00:00 2001 From: Nathan <148575555+nathan-artie@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:16:22 -0700 Subject: [PATCH 4/8] Rename --- .github/workflows/{gha-go-test.yml => go-checks.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{gha-go-test.yml => go-checks.yml} (98%) diff --git a/.github/workflows/gha-go-test.yml b/.github/workflows/go-checks.yml similarity index 98% rename from .github/workflows/gha-go-test.yml rename to .github/workflows/go-checks.yml index 161c47042..249f34310 100644 --- a/.github/workflows/gha-go-test.yml +++ b/.github/workflows/go-checks.yml @@ -1,4 +1,4 @@ -name: Go tests +name: Go checks on: [push] From 5cdd756c28ef7740bdd45bcbbef377369d7e68ff Mon Sep 17 00:00:00 2001 From: Nathan <148575555+nathan-artie@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:18:15 -0700 Subject: [PATCH 5/8] Add some space --- .github/workflows/go-checks.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/go-checks.yml b/.github/workflows/go-checks.yml index 249f34310..80762958d 100644 --- a/.github/workflows/go-checks.yml +++ b/.github/workflows/go-checks.yml @@ -7,12 +7,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Go uses: actions/setup-go@v5 with: go-version: 1.23 + - name: Install dependencies run: go mod download + - name: Run staticcheck env: SC_VERSION: "2024.1.1" @@ -21,9 +24,12 @@ jobs: SC_URL="https://github.com/dominikh/go-tools/releases/download/$SC_VERSION/staticcheck_linux_amd64.tar.gz" wget -q ${SC_URL} -O - | tar -xzf - --strip-components 1 -C /usr/local/bin staticcheck/staticcheck make static + - name: Run vet run: make vet + - name: Run tests + race condition check run: make race + - name: Check Go files are properly formatted run: test -z $(gofmt -l .) From c4ae6cfaba818ef6d6335de29515678cc84e0d18 Mon Sep 17 00:00:00 2001 From: Nathan <148575555+nathan-artie@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:18:56 -0700 Subject: [PATCH 6/8] Vet first --- .github/workflows/go-checks.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go-checks.yml b/.github/workflows/go-checks.yml index 80762958d..342c05169 100644 --- a/.github/workflows/go-checks.yml +++ b/.github/workflows/go-checks.yml @@ -16,6 +16,9 @@ jobs: - name: Install dependencies run: go mod download + - name: Run vet + run: make vet + - name: Run staticcheck env: SC_VERSION: "2024.1.1" @@ -25,9 +28,6 @@ jobs: wget -q ${SC_URL} -O - | tar -xzf - --strip-components 1 -C /usr/local/bin staticcheck/staticcheck make static - - name: Run vet - run: make vet - - name: Run tests + race condition check run: make race From b5058a8b15e4fe8db352d0493cfa3c37194f83c9 Mon Sep 17 00:00:00 2001 From: Nathan <148575555+nathan-artie@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:20:27 -0700 Subject: [PATCH 7/8] Mocks step --- .github/workflows/go-checks.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go-checks.yml b/.github/workflows/go-checks.yml index 342c05169..39de4a4da 100644 --- a/.github/workflows/go-checks.yml +++ b/.github/workflows/go-checks.yml @@ -16,6 +16,9 @@ jobs: - name: Install dependencies run: go mod download + - name: Generage mocks + run: make generate + - name: Run vet run: make vet @@ -23,7 +26,6 @@ jobs: env: SC_VERSION: "2024.1.1" run: | - make generate SC_URL="https://github.com/dominikh/go-tools/releases/download/$SC_VERSION/staticcheck_linux_amd64.tar.gz" wget -q ${SC_URL} -O - | tar -xzf - --strip-components 1 -C /usr/local/bin staticcheck/staticcheck make static From 219ad0b155ff47d172b62b3941d13453cde225ee Mon Sep 17 00:00:00 2001 From: Nathan <148575555+nathan-artie@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:20:40 -0700 Subject: [PATCH 8/8] Spelling --- .github/workflows/go-checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-checks.yml b/.github/workflows/go-checks.yml index 39de4a4da..06a84f904 100644 --- a/.github/workflows/go-checks.yml +++ b/.github/workflows/go-checks.yml @@ -16,7 +16,7 @@ jobs: - name: Install dependencies run: go mod download - - name: Generage mocks + - name: Generate mocks run: make generate - name: Run vet