Allow connection of BFG to another BFG for L2 Keystone Notifications/Querying #1146
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
# Copyright (c) 2024 Hemi Labs, Inc. | |
# Use of this source code is governed by the MIT License, | |
# which can be found in the LICENSE file. | |
# GitHub Actions workflow to lint, build and test. | |
name: "Go" | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
workflow_call: | |
concurrency: | |
group: "go-${{ github.workflow }}-${{ github.event.number || github.ref }}" | |
cancel-in-progress: "${{ github.event_name == 'pull_request' }}" | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: "Build" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
go-version: [ "1.23.x" ] | |
services: | |
postgres: | |
image: postgres:16.3-alpine3.20 | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_PASSWORD: "postgres" | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: "Checkout repository" | |
uses: actions/checkout@v4 | |
- name: "Setup Go ${{ matrix.go-version }}" | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "${{ matrix.go-version }}" | |
cache: true | |
check-latest: true | |
- name: "Retrieve GOPATH" | |
id: retrieve | |
run: echo "GOPATH=$(go env GOPATH)" >> "$GITHUB_OUTPUT" | |
- name: "Setup GOPATH/bin cache" | |
uses: actions/cache@v4 | |
with: | |
path: "${{ steps.retrieve.outputs.GOPATH }}/bin/" | |
key: "${{ runner.os }}-${{ runner.arch }}-gobin-go${{ env.GO_VERSION }}-${{ hashFiles('**/Makefile') }}" | |
restore-keys: | | |
${{ runner.os }}-${{ runner.arch }}-gobin-go${{ env.GO_VERSION }}-${{ hashFiles('**/Makefile') }} | |
${{ runner.os }}-${{ runner.arch }}-gobin-go${{ env.GO_VERSION }}- | |
${{ runner.os }}-${{ runner.arch }}-gobin- | |
- name: "Download and verify dependencies" | |
id: deps | |
run: make GOCACHE="$(go env GOCACHE)" deps | |
- name: "make race" | |
run: make GOCACHE="$(go env GOCACHE)" race | |
- name: "make" | |
if: (success() || failure()) && steps.deps.outcome == 'success' | |
env: | |
PGTESTURI: "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" | |
HEMI_DOCKER_TESTS: "1" | |
run: | | |
make GOCACHE="$(go env GOCACHE)" | |
git diff --exit-code |