Skip to content

upgrade to v2 (#12) #111

upgrade to v2 (#12)

upgrade to v2 (#12) #111

Workflow file for this run

name: build and test
on:
pull_request:
push:
branches:
- main
tags-ignore:
- '**'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
id: go
- name: Run tests
run: go test -race -count=1 -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- name: Build app
id: build_go_app
run: |
go build -v .
echo ::set-output name=exit_code::$?
- name: Notify Slack on success
if: steps.build_go_app.outputs.exit_code == 0
id: slack_notification
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notification_title: 'Build succeeded'
message_format: 'Statoo build succeeded. <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>'
footer: 'repo: <{repo_url}|{repo}>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}