.github/workflows/tools.yml
name: tooling
on:
pull_request:
branches: [ '*' ]
paths:
- '.github/workflows/tools.yml'
- 'tools/*'
push:
branches: [ '*' ]
paths:
- '.github/workflows/tools.yml'
- 'tools/*'
tags: [ '!*' ]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with: { fetch-depth: 0 }
- uses: actions/setup-go@v3
with: { go-version: '1.18' }
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-go-${{ hashFiles('tools/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- run: make tools
- run: '[ $(ls bin/linux/*/* | wc -l) = $(grep go:gen tools/tools.go | wc -l) ]'
- run: make pre-push
notify:
needs: [ build ]
if: ${{ failure() || success() }}
runs-on: ubuntu-18.04
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ needs.build.result }}
SLACK_ICON: https://github.com/github.png?size=64
SLACK_TITLE: '${{ github.repository }}: ${{ github.workflow }}'
SLACK_USERNAME: GitHub Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}