feat(e2e): add make build target for local docker image
Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
parent
3978b2f27f
commit
e0c472a02d
|
|
@ -3,79 +3,79 @@ name: Continuous Integration
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- master
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- "**"
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
COVER: true
|
COVER: true
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
env:
|
env:
|
||||||
# renovate: datasource=github-tags depName=golangci/golangci-lint
|
# renovate: datasource=github-tags depName=golangci/golangci-lint
|
||||||
GOLANGCI_LINT_VERSION: v2.4.0
|
GOLANGCI_LINT_VERSION: v2.4.0
|
||||||
run: |
|
run: |
|
||||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
|
||||||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
||||||
chmod +x ./cc-test-reporter
|
chmod +x ./cc-test-reporter
|
||||||
|
|
||||||
- name: Verify Code Generation
|
- name: Verify Code Generation
|
||||||
run: |
|
run: |
|
||||||
make verify-generate
|
make verify-generate
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: |
|
run: |
|
||||||
make lint
|
make lint
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
if: (!startsWith(github.head_ref, 'release'))
|
if: (!startsWith(github.head_ref, 'release'))
|
||||||
run: |
|
run: |
|
||||||
make build
|
make build
|
||||||
|
|
||||||
# For release testing
|
# For release testing
|
||||||
- name: Build All
|
- name: Build All
|
||||||
if: github.base_ref == 'master' && startsWith(github.head_ref, 'release')
|
if: github.base_ref == 'master' && startsWith(github.head_ref, 'release')
|
||||||
run: |
|
run: |
|
||||||
make release
|
make release
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
env:
|
env:
|
||||||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
||||||
run: |
|
run: |
|
||||||
./.github/workflows/test.sh
|
./.github/workflows/test.sh
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Docker Build
|
- name: Set up Docker Buildx
|
||||||
if: (!startsWith(github.head_ref, 'release'))
|
id: buildx
|
||||||
run: |
|
uses: docker/setup-buildx-action@v3
|
||||||
make build-docker
|
|
||||||
|
|
||||||
# For release testing
|
- name: Docker Build
|
||||||
- name: Docker Build All
|
if: (!startsWith(github.head_ref, 'release'))
|
||||||
if: github.base_ref == 'master' && startsWith(github.head_ref, 'release')
|
run: |
|
||||||
run: |
|
make build-docker
|
||||||
make build-docker-all
|
|
||||||
|
# For release testing
|
||||||
|
- name: Docker Build All
|
||||||
|
if: github.base_ref == 'master' && startsWith(github.head_ref, 'release')
|
||||||
|
run: |
|
||||||
|
make build-docker-all
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ release
|
||||||
.env
|
.env
|
||||||
.bundle
|
.bundle
|
||||||
c.out
|
c.out
|
||||||
|
e2e
|
||||||
|
|
||||||
# Go.gitignore
|
# Go.gitignore
|
||||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||||
|
|
|
||||||
4
Makefile
4
Makefile
|
|
@ -75,6 +75,10 @@ DOCKER_BUILDX_PUSH_X_PLATFORM_ALPINE := $(DOCKER_BUILDX_X_PLATFORM_ALPINE) --pus
|
||||||
.PHONY: build-docker
|
.PHONY: build-docker
|
||||||
build-docker: build-distroless build-alpine ## Build multi architecture docker images in both flavours (distroless / alpine)
|
build-docker: build-distroless build-alpine ## Build multi architecture docker images in both flavours (distroless / alpine)
|
||||||
|
|
||||||
|
.PHONY: build-docker-local
|
||||||
|
build-docker-local: ## Build distroless docker image and locally load into docker images
|
||||||
|
$(DOCKER_BUILDX) --load -t $(REGISTRY)/$(REPOSITORY):latest -t $(REGISTRY)/$(REPOSITORY):${VERSION} .
|
||||||
|
|
||||||
.PHONY: build-distroless
|
.PHONY: build-distroless
|
||||||
build-distroless: ## Build multi architecture distroless based docker image
|
build-distroless: ## Build multi architecture distroless based docker image
|
||||||
$(DOCKER_BUILDX_X_PLATFORM) -t $(REGISTRY)/$(REPOSITORY):latest -t $(REGISTRY)/$(REPOSITORY):${VERSION} .
|
$(DOCKER_BUILDX_X_PLATFORM) -t $(REGISTRY)/$(REPOSITORY):latest -t $(REGISTRY)/$(REPOSITORY):${VERSION} .
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue