Merge pull request #1442 from bnb-chain/develop #6419
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: Build Test | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
- fix-release* | |
pull_request: | |
branches: | |
jobs: | |
build-test: | |
strategy: | |
matrix: | |
go-version: [1.20.x] | |
os: [ ubuntu-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- 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- | |
- uses: bufbuild/[email protected] | |
with: | |
version: 1.14.0 | |
buf_user: "${{ secrets.BUF_REGISTRY_USER }}" | |
buf_api_token: "${{ secrets.BUF_REGISTRY_SECRET }}" | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
- run: | | |
make install-tools | |
make buf-gen | |
- name: Test Build | |
run: | | |
make build | |
# build-test-success: | |
# needs: build-test | |
# if: ${{ success() }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Notify Slack on success | |
# uses: rtCamp/[email protected] | |
# env: | |
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
# SLACK_CHANNEL: greenfield_storage_ci | |
# SLACK_USERNAME: SP Build Test | |
# SLACK_ICON_EMOJI: ':heavy_check_mark:' | |
# SLACK_COLOR: good | |
# SLACK_MESSAGE: Greenfield SP build test passed | |
# SLACK_FOOTER: '' | |
# build-test-failure: | |
# needs: build-test | |
# if: ${{ failure() }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Notify Slack on failure | |
# uses: rtCamp/[email protected] | |
# env: | |
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
# SLACK_CHANNEL: greenfield_storage_ci | |
# SLACK_USERNAME: SP Build Test | |
# SLACK_ICON_EMOJI: ':x:' | |
# SLACK_COLOR: danger | |
# SLACK_MESSAGE: Greenfield SP build test failed | |
# SLACK_FOOTER: '' |