build(deps): bump github.com/vektra/mockery/v2 from 2.27.1 to 2.36.1 in /_tools #147
Workflow file for this run
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: CI | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
release: | |
types: [published] | |
jobs: | |
lint: | |
name: Lint | |
if: ${{ github.event.head_commit.message != 'Initial commit' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.18" | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.46 | |
test: | |
name: Test | |
if: ${{ github.event.head_commit.message != 'Initial commit' }} | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14.4-alpine | |
env: | |
POSTGRES_USER: ${{ github.event.repository.name }} | |
POSTGRES_PASSWORD: ${{ github.event.repository.name }} | |
POSTGRES_DB: ${{ github.event.repository.name }} | |
ports: | |
- 5432/tcp | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.18" | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Restore Cache | |
uses: actions/cache@v3 | |
with: | |
# In order: | |
# * Module download cache | |
# * Build cache (Linux) | |
# * Build cache (Mac) | |
# * Build cache (Windows) | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
~/Library/Caches/go-build | |
%LocalAppData%\go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Test | |
env: | |
GO_TG_BOT_POSTGRES_DSN: postgres://${{ github.event.repository.name }}:${{ github.event.repository.name }}@localhost:${{ job.services.postgres.ports[5432] }}/${{ github.event.repository.name }}?sslmode=disable | |
run: go test -v -race -covermode=atomic -coverprofile=coverage.txt ./... | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
build_and_push: | |
name: Build and Push | |
runs-on: ubuntu-latest | |
needs: [test, lint] | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
permissions: | |
packages: write | |
contents: read | |
deployments: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Calculate build args | |
id: build_info | |
run: | | |
echo ::set-output name=ref::$(git rev-parse --short "$GITHUB_SHA") | |
echo ::set-output name=version::${GITHUB_REF##*/} | |
echo ::set-output name=time::$(date --utc +%FT%TZ) | |
- name: Build and Push | |
id: build_and_push | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}:dev | |
build-args: | | |
BUILD_VERSION=${{ steps.build_info.outputs.version }} | |
BUILD_REF=${{ steps.build_info.outputs.ref }} | |
BUILD_TIME=${{ steps.build_info.outputs.time }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache-new | |
# Temp fix @todo | |
# https://github.com/docker/build-push-action/issues/252 | |
# https://github.com/moby/buildkit/issues/1896 | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
- name: Image digest | |
run: echo ${{ steps.build_and_push.outputs.digest }} |