Fix patch #4
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 Artifacts | |
on: | |
push: | |
branches: | |
- '**' | |
jobs: | |
multiplatform_build: | |
strategy: | |
fail-fast: false | |
matrix: | |
component: | |
- name: disaster-recovery-daemon | |
file: docker/Dockerfile | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
no-cache: true | |
context: ${{ matrix.component.dir }} | |
file: ${{ matrix.component.file }} | |
platforms: linux/amd64,linux/arm64 | |
push: false | |
tags: ${{ matrix.component.name }} | |
provenance: false | |
# Step 2: Set up Go environment | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' # specify the version you need | |
# Step 3: Cache Go modules to speed up build times | |
- name: Cache Go modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
# Step 4: Install dependencies | |
- name: Install dependencies | |
run: go mod download | |
# Step 5: Run unit tests | |
- name: Run tests | |
run: go test -v ./... | |
# Step 6: Build the package | |
- name: Build | |
run: go build -v ./... |