From 13d410c9fbd6aa0a62ef2911d8b9e80d97059ed5 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Thu, 14 Sep 2023 02:20:37 +0200 Subject: [PATCH 1/3] added testing which is run in CI before building the docker file --- .github/workflows/ci.yml | 6 ++---- .github/workflows/main.yml | 11 +++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92b0e5a9..31396cee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,12 @@ -name: CI +name: lint on: - push: - branches: [ main ] pull_request: permissions: contents: read jobs: - ci: + lint: name: lint runs-on: ubuntu-latest steps: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a06b89a..40cd3996 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,17 @@ on: pull_request: branches: [ main ] jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: false + - name: run tests + run: go test -v ./... + working-directory: ./server build: runs-on: ubuntu-latest steps: From 4c12a2cdd76dad441cc2c2ba2e4313acd9327020 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Thu, 14 Sep 2023 02:22:05 +0200 Subject: [PATCH 2/3] fixed `build` not depending on `test` --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 40cd3996..47648b85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,7 @@ jobs: working-directory: ./server build: runs-on: ubuntu-latest + needs: [test] steps: - name: Checkout repository uses: actions/checkout@v3 From fd688858b0fdf873d90d0aded77e8f0cd5c1e08c Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Thu, 14 Sep 2023 02:27:18 +0200 Subject: [PATCH 3/3] fixed the setup-go not using a cached path leading to excessive download times --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 47648b85..48d0b6b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,8 @@ jobs: - uses: actions/setup-go@v4 with: go-version: '1.21' - cache: false + cache-dependency-path: | + server/go.sum - name: run tests run: go test -v ./... working-directory: ./server