[Supplier] feat: Add staking flag and config parser #881
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Ignite build & test | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
concurrency: | |
group: ${{ github.head_ref || github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: install ignite | |
# If this step fails due to ignite.com failing, see #116 for a temporary workaround | |
run: | | |
curl https://get.ignite.com/cli! | bash | |
ignite version | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "0" # Per https://github.com/ignite/cli/issues/1674#issuecomment-1144619147 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20" | |
- name: Install CI dependencies | |
run: make install_ci_deps | |
- name: Generate protobufs | |
run: make proto_regen | |
- name: Generate mocks | |
run: make go_mockgen | |
- name: Run golangci-lint | |
run: make go_lint | |
- name: Build | |
run: ignite chain build -v --debug --skip-proto | |
- name: Test | |
run: make go_test | |
- name: Set up Docker Buildx | |
if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image')) | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker Metadata action | |
if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image')) | |
id: meta | |
uses: docker/metadata-action@v5 | |
env: | |
DOCKER_METADATA_PR_HEAD_SHA: "true" | |
with: | |
images: | | |
ghcr.io/pokt-network/pocketd | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=sha | |
type=sha,format=long | |
- name: Login to GitHub Container Registry | |
if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image')) | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Copy binary to inside of the Docker context | |
if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image')) | |
run: | | |
mkdir -p ./bin # Make sure the bin directory exists | |
cp $(go env GOPATH)/bin/poktrolld ./bin # Copy the binary to the repo's bin directory | |
- name: Build and push Docker image | |
if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image')) | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
# NB: Uncomment below if arm64 build is needed; arm64 builds are off by default because build times are significant. | |
platforms: linux/amd64 #,linux/arm64 | |
file: Dockerfile.dev | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
context: . |