Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Use QEMU as Docker push multi arch shortcoming #52

Merged
merged 2 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,51 @@ jobs:
- name: Maven verify
run: ./mvnw clean verify

docker:
if: (github.event_name != 'schedule') || (github.repository == 'korandoru/hawkeye')
name: Check Docker image - ${{matrix.runner}}
strategy:
fail-fast: false
matrix:
runner: [buildjet-4vcpu-ubuntu-2204, buildjet-4vcpu-ubuntu-2204-arm]
runs-on: ${{matrix.runner}}
steps:
- uses: actions/checkout@v3
- name: Build hawkeye
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
load: true
tags: ghcr.io/korandoru/hawkeye:latest
- name: Build hawkeye-native
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile.native
load: true
tags: ghcr.io/korandoru/hawkeye-native:latest
- name: Check license headers
uses: ./
- name: Run sanity checks
run: |
docker run --rm -v $(pwd):/github/workspace ghcr.io/korandoru/hawkeye:latest check
docker run --rm -v $(pwd):/github/workspace ghcr.io/korandoru/hawkeye-native:latest check

required:
name: Required
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{ always() && ((github.event_name != 'schedule') || (github.repository == 'korandoru/hawkeye')) }}
needs:
- check
- docker
- unittest
steps:
- name: Guardian
run: |
if [[ ! ( \
"${{ needs.check.result }}" == "success" \
&& "${{ needs.docker.result }}" == "success" \
&& "${{ needs.unittest.result }}" == "success" \
) ]]; then
echo "Required jobs haven't been completed successfully."
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,31 @@ name: Release

on:
push:
branches: [main]
tags: ['v1.*']
pull_request:
branches: [main]
paths: ['.github/workflows/release.yml']
workflow_dispatch:

jobs:
release-docker-image:
name: Release - ${{matrix.name}} - ${{matrix.platform}}
name: Release - ${{matrix.name}}
strategy:
matrix:
name: [hawkeye, hawkeye-native]
file: [Dockerfile, Dockerfile.native]
runner: [buildjet-4vcpu-ubuntu-2204, buildjet-4vcpu-ubuntu-2204-arm]
platform: [linux/amd64, linux/arm64]
exclude:
- name: hawkeye
file: Dockerfile.native
- name: hawkeye-native
file: Dockerfile
- runner: buildjet-4vcpu-ubuntu-2204
platform: linux/arm64
- runner: buildjet-4vcpu-ubuntu-2204-arm
platform: linux/amd64
runs-on: ${{matrix.runner}}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
Expand Down Expand Up @@ -74,7 +68,7 @@ jobs:
with:
context: .
file: ./${{ matrix.file }}
platforms: ${{ matrix.platform }}
platforms: linux/amd64, linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}