build(deps): bump google.golang.org/grpc from 1.57.0 to 1.59.0 #124
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration | |
# yamllint disable-line rule:truthy | |
on: | |
push: | |
branches: | |
- master | |
tags-ignore: | |
- "*" | |
paths: | |
- .dockerignore | |
- .github/workflows/integration.yml | |
- .golangci.yaml | |
- .goreleaser.yaml | |
- '**.go' | |
- container-structure-test.yaml | |
- Dockerfile | |
- go.mod | |
- go.sum | |
- sonar-project.properties | |
pull_request: | |
branches: | |
- master | |
paths: | |
- .dockerignore | |
- .github/workflows/integration.yml | |
- .golangci.yaml | |
- .goreleaser.yaml | |
- '**.go' | |
- container-structure-test.yaml | |
- Dockerfile | |
- go.mod | |
- go.sum | |
- sonar-project.properties | |
env: | |
GOLANG_VERSION: "1.20" | |
GOLANG_FLAGS: -race -mod=readonly | |
WORK_DIR: /usr/src | |
permissions: | |
contents: read | |
jobs: | |
metadata: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: calculate version | |
uses: paulhatch/semantic-version@v5.0.3 | |
id: version | |
with: | |
branch: ${{ github.ref_name }} | |
bump_each_commit: false | |
change_path: >- | |
cmd/handler | |
internal | |
go.mod | |
go.sum | |
major_pattern: /^BREAKING CHANGE:|^[^()!:]+(?:\([^()!:]+\))?!:/ | |
minor_pattern: /^feat(?:\([^()!:]+\))?:/ | |
search_commit_body: true | |
user_format_type: csv | |
version_format: ${major}.${minor}.${patch}-rc.${increment} | |
- name: generate container meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
context: workflow | |
images: ${{ github.repository }} | |
flavor: | | |
latest=true | |
# yamllint disable rule:line-length | |
labels: | | |
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}/blob/master/README.md | |
org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
org.opencontainers.image.url=https://hub.docker.com/r/${{ github.repository }} | |
org.opencontainers.image.version=${{ steps.version.outputs.version }} | |
# yamllint enable rule:line-length | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=raw,value=${{ env.BRANCH }} | |
type=semver,pattern={{version}} | |
github-token: ${{ github.token }} | |
outputs: | |
major: ${{ steps.version.outputs.major }} | |
minor: ${{ steps.version.outputs.minor }} | |
patch: ${{ steps.version.outputs.patch }} | |
increment: ${{ steps.version.outputs.increment }} | |
version_type: ${{ steps.version.outputs.version_type }} | |
version: ${{ steps.version.outputs.version }} | |
tag: ${{ steps.version.outputs.version_tag }} | |
revision: ${{ steps.version.outputs.current_commit }} | |
authors: ${{ steps.version.outputs.authors }} | |
container-labels: ${{ steps.meta.outputs.labels }} | |
container-tags: ${{ steps.meta.outputs.tags }} | |
build: | |
runs-on: ubuntu-latest | |
needs: metadata | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup golang | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GOLANG_VERSION }} | |
- name: set golang environment variables | |
uses: wwmoraes/actions/golang/env@master | |
- name: cache modules | |
uses: pat-s/always-upload-cache@v2.1.5 | |
with: | |
path: ${GOMODCACHE} | |
key: ${{ runner.os }}-modules-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-modules-${{ hashFiles('go.sum') }} | |
${{ runner.os }}-modules- | |
- name: download modules | |
run: go mod download | |
- name: cache build | |
uses: pat-s/always-upload-cache@v2.1.5 | |
with: | |
path: ${GOCACHE} | |
key: ${{ runner.os }}-build-${{ hashFiles('**/*.go') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ hashFiles('**/*.go') }} | |
${{ runner.os }}-build- | |
- name: generate | |
run: go generate ./... | |
env: | |
VERSION: ${{ needs.metadata.outputs.version }}+${{ github.sha }} | |
- name: build | |
uses: wwmoraes/actions/golang/build@master | |
lint: | |
runs-on: ubuntu-latest | |
env: | |
CONTAINER_LINT_REPORT_FILE: hadolint-report.json | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup golang | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GOLANG_VERSION }} | |
- name: set golang environment variables | |
uses: wwmoraes/actions/golang/env@master | |
- name: cache modules | |
uses: pat-s/always-upload-cache@v2.1.5 | |
with: | |
path: ${GOMODCACHE} | |
key: ${{ runner.os }}-modules-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-modules-${{ hashFiles('go.sum') }} | |
${{ runner.os }}-modules- | |
- name: download modules | |
run: go mod download | |
- name: cache lint | |
uses: pat-s/always-upload-cache@v2.1.5 | |
with: | |
path: ${HOME}/.cache/golangci-lint | |
key: ${{ runner.os }}-lint-${{ hashFiles('.golangci.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-lint-${{ hashFiles('.golangci.yaml') }} | |
${{ runner.os }}-lint- | |
- name: lint code source | |
uses: wwmoraes/actions/golang/lint@master | |
id: lint | |
with: | |
work-dir: ${{ env.WORK_DIR }} | |
version: v1.46-alpine | |
- name: upload code lint report | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: source-lint-report | |
path: ${{ steps.lint.outputs.report-file }} | |
- name: lint container source | |
uses: hadolint/hadolint-action@v3.1.0 | |
with: | |
dockerfile: Dockerfile | |
format: sonarqube | |
output-file: ${{ env.CONTAINER_LINT_REPORT_FILE }} | |
- name: upload container lint report | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: container-lint-report | |
path: ${{ env.CONTAINER_LINT_REPORT_FILE }} | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup golang | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GOLANG_VERSION }} | |
- name: set golang environment variables | |
uses: wwmoraes/actions/golang/env@master | |
- name: cache modules | |
uses: pat-s/always-upload-cache@v2.1.5 | |
with: | |
path: ${GOMODCACHE} | |
key: ${{ runner.os }}-modules-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-modules-${{ hashFiles('go.sum') }} | |
${{ runner.os }}-modules- | |
- name: download modules | |
run: go mod download | |
- name: cache test | |
uses: pat-s/always-upload-cache@v2.1.5 | |
with: | |
path: ${GOCACHE} | |
key: ${{ runner.os }}-test-${{ hashFiles('**/*.go') }} | |
restore-keys: | | |
${{ runner.os }}-test-${{ hashFiles('**/*.go') }} | |
${{ runner.os }}-test- | |
- name: test | |
uses: wwmoraes/actions/golang/integration@master | |
id: test | |
with: | |
run-flags: -race -mod=readonly | |
packages: ./cmd/internal/integration/... | |
coverage-packages: |- | |
github.com/${{ github.repository }}/internal/usecases | |
github.com/${{ github.repository }}/internal/adapters | |
- name: upload coverage report | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: coverage-report | |
path: ${{ steps.test.outputs.cover-profile }} | |
- name: upload test report | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: test-report | |
path: ${{ steps.test.outputs.report-file }} | |
report: | |
runs-on: ubuntu-latest | |
needs: [lint, test] | |
if: always() | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: cache sonar scanner | |
uses: pat-s/always-upload-cache@v2.1.5 | |
if: false | |
with: | |
path: ${{ runner.temp }}/sonar-scanner/cache | |
# yamllint disable-line rule:line-length | |
key: ${{ runner.os }}-sonar-scanner-cache-${{ hashFiles('**/sonar-project.properties') }} | |
# yamllint disable rule:line-length | |
restore-keys: | | |
${{ runner.os }}-sonar-scanner-cache-${{ hashFiles('**/sonar-project.properties') }} | |
${{ runner.os }}-sonar-scanner-cache- | |
# yamllint enable rule:line-length | |
- name: download source lint report | |
uses: actions/download-artifact@v3 | |
with: | |
name: source-lint-report | |
- name: download container lint report | |
uses: actions/download-artifact@v3 | |
with: | |
name: container-lint-report | |
- name: download test report | |
uses: actions/download-artifact@v3 | |
with: | |
name: test-report | |
- name: download coverage report | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-report | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: run sonar scanner | |
uses: wwmoraes/actions/sonar-scanner@master | |
if: false | |
with: | |
token: ${{ secrets.SONAR_TOKEN }} | |
work-dir: ${{ env.WORK_DIR }} | |
home: ${{ runner.temp }}/sonar-scanner | |
container: | |
runs-on: ubuntu-latest | |
needs: metadata | |
env: | |
# runner context is not available here... | |
GRYPE_DB_CACHE_TEMP_PATH: .cache/grype/db/ | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: set up docker buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: cache buildx | |
uses: pat-s/always-upload-cache@v2.1.5 | |
with: | |
path: ${{ runner.temp }}/.buildx-cache | |
# yamllint disable-line rule:line-length | |
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile', '.dockerignore') }} | |
# yamllint disable rule:line-length | |
restore-keys: | | |
${{ runner.os }}-buildx-${{ hashFiles('Dockerfile', '.dockerignore') }} | |
${{ runner.os }}-buildx- | |
# yamllint enable rule:line-length | |
- name: build single-arch test image | |
uses: docker/build-push-action@v3 | |
env: | |
DOCKER_BUILDKIT: 0 | |
BUILDKIT_INLINE_CACHE: 1 | |
with: | |
push: false | |
load: true | |
labels: ${{ needs.metadata.outputs.container-labels }} | |
cache-to: | | |
type=local,mode=max,dest=${{ runner.temp }}/.buildx-cache-new | |
cache-from: | | |
type=local,src=${{ runner.temp }}/.buildx-cache | |
${{ needs.metadata.outputs.container-tags }} | |
${{ github.repository }}:test | |
tags: ${{ github.repository }}:test | |
build-args: | | |
GOLANG_VERSION=${{ env.GOLANG_VERSION }} | |
VERSION=${{ needs.metadata.outputs.version }} | |
# fix to prevent ever-growing caches | |
# https://github.com/docker/build-push-action/issues/252 | |
# https://github.com/moby/buildkit/issues/1896 | |
- name: Move cache | |
run: | | |
rm -rf ${{ runner.temp }}/.buildx-cache | |
mv ${{ runner.temp }}/.buildx-cache-new ${{ runner.temp }}/.buildx-cache | |
- name: test structure | |
uses: brpaz/structure-tests-action@v1.1.2 | |
with: | |
image: ${{ github.repository }}:test | |
configFile: container-structure-test.yaml |