Skip to content

tests: add tests for pkg/broker/redis (#50) #46

tests: add tests for pkg/broker/redis (#50)

tests: add tests for pkg/broker/redis (#50) #46

Workflow file for this run

name: Build and Publish Docker Image
on:
push:
branches:
- main
- chore/badge
jobs:
build-and-push:
runs-on: ubuntu-latest
name: build and publish
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: stable
- name: Run Test
run: |
go test -v ./... -covermode=count -coverprofile=coverage.out
go tool cover -func=coverage.out -o=coverage.out
- name: Go Coverage Badge # Pass the `coverage.out` output to this action
uses: tj-actions/coverage-badge-go@v2
with:
filename: coverage.out
target: Readme.md
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files
with:
files: Readme.md
- name: Commit changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add Readme.md
git commit -m "chore: Updated coverage badge."
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.ref_name }}
- name: Build
run: go build -v ./...
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm64/v8
push: true
tags: quay.io/abhishekvrshny/propeller:latest