Skip to content

Commit

Permalink
build(gha): Update setup-go github action
Browse files Browse the repository at this point in the history
* Upgrade to the v4 version
* Check golang version from the `go.mod` file
  • Loading branch information
akosveres committed Oct 4, 2023
1 parent ed583ab commit 373271c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main-merge.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and push
on:
push:
branches: [ main ]
branches: [main]

env:
REGISTRY: ghcr.io
Expand All @@ -18,9 +18,9 @@ jobs:
uses: actions/checkout@v1

- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version-file: "go.mod"

- name: Start kind cluster
uses: helm/[email protected]
Expand All @@ -41,8 +41,8 @@ jobs:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# GO_MODULES: "on"

# Docker buildx does not allow for multi architecture builds and loading the docker container locally,
# this way we can not run trivy against the containers, one solution is to run multiple jobs for each arch
# Docker buildx does not allow for multi architecture builds and loading the docker container locally,
# this way we can not run trivy against the containers, one solution is to run multiple jobs for each arch

docker:
name: Docker build
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and test Go
on:
pull_request:
branches: [ main ]
branches: [main]

env:
REGISTRY: ghcr.io
Expand All @@ -10,7 +10,6 @@ env:
GO_MODULES: on

jobs:

golang:
name: Golang build
runs-on: ubuntu-latest
Expand All @@ -19,9 +18,9 @@ jobs:
uses: actions/checkout@v1

- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version-file: "go.mod"

# We need kind to test the code
- name: Start kind cluster
Expand All @@ -43,9 +42,9 @@ jobs:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# GO_MODULES: "on"

# Docker buildx does not allow for multi architecture builds and loading the docker container locally,
# this way we can not run trivy against the containers, one solution is to run multiple jobs for each arch
# ARM builds are really slow, we're only doing it in the `main-merge` workflow.
# Docker buildx does not allow for multi architecture builds and loading the docker container locally,
# this way we can not run trivy against the containers, one solution is to run multiple jobs for each arch
# ARM builds are really slow, we're only doing it in the `main-merge` workflow.
docker:
name: Docker build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -98,6 +97,5 @@ jobs:
IMAGE: ${{ steps.docker_meta.outputs.tags }}
with:
image-ref: ${{ env.IMAGE }}
format: 'table'
exit-code: '1'

format: "table"
exit-code: "1"

0 comments on commit 373271c

Please sign in to comment.