Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hsoerensen committed Aug 6, 2024
1 parent cf2df39 commit 382de05
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 23 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: build

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
tags:
- '*'
workflow_dispatch:

permissions:
contents: read
Expand All @@ -17,9 +18,9 @@ jobs:
platform: [ linux/amd64, linux/arm64 ]
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
Expand All @@ -31,9 +32,7 @@ jobs:
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Build Docker Image
run: docker buildx build --platform ${{ matrix.platform }} -t voi-node:${{ matrix.platform }} --load .
- name: Run Tests in Docker Container
run: docker run --rm voi-node:${{ matrix.platform }} make test
- name: Build all
run: docker run --rm voi-node:${{ matrix.platform }} make all
- name: Run Bake
run: docker buildx bake --file bake.hcl --set *.platform=${{ matrix.platform }} --load
- name: Run Unit Tests
run: make test
21 changes: 8 additions & 13 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
release:
types: [ published ]
types: [published]
workflow_dispatch:

jobs:
push_to_registries:
name: Push Docker image to registry
runs-on: ubuntu-latest
strategy:
matrix:
platform: [linux/amd64, linux/arm64]
permissions:
packages: write
contents: read
Expand Down Expand Up @@ -50,9 +45,9 @@ jobs:
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
platforms: linux/amd64,linux/arm64
platforms: ${{ matrix.platform }}
build-args: |
BASE_ALGORAND_VERSION=3.25.0
push: true
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
31 changes: 31 additions & 0 deletions bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
group "default" {
targets = ["build", "test", "all"]
}

target "build" {
platforms = ["linux/amd64", "linux/arm64"]
tags = ["voi-node"]
context = "."
dockerfile = "Dockerfile"
}

target "test" {
inherits = ["build"]
args = {
TARGET = "test"
}
commands = [
"make test"
]
}

target "all" {
inherits = ["build"]
args = {
TARGET = "all"
}

commands = [
"make all"
]
}

0 comments on commit 382de05

Please sign in to comment.