-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
346 additions
and
211 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
groups: | ||
gha-dependencies: | ||
patterns: | ||
- '*' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
name: Build images and upload them to ghcr.io | ||
|
||
env: | ||
BUILDKIT_PROGRESS: plain | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runsOn: | ||
description: GitHub Actions Runner image | ||
required: true | ||
type: string | ||
platforms: | ||
description: Target platforms for the build (linux/amd64 and/or linux/arm64) | ||
required: true | ||
type: string | ||
outputs: | ||
image: | ||
description: Image identified by digests | ||
value: ${{ jobs.build.outputs.image }} | ||
|
||
jobs: | ||
build: | ||
name: ${{ inputs.platforms }} | ||
runs-on: ${{ inputs.runsOn }} | ||
timeout-minutes: 120 | ||
|
||
outputs: | ||
image: ${{ steps.bake_metadata.outputs.image }} | ||
|
||
# Make sure we fail if any command in a piped command sequence fails | ||
defaults: | ||
run: | ||
shell: bash -e -o pipefail {0} | ||
|
||
steps: | ||
|
||
- name: Checkout Repo ⚡️ | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
if: ${{ inputs.platforms != 'linux/amd64' }} | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry 🔑 | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and upload to ghcr.io 📤 | ||
id: build-upload | ||
uses: docker/bake-action@v4 | ||
with: | ||
push: true | ||
# Using provenance to disable default attestation so it will build only desired images: | ||
# https://github.com/orgs/community/discussions/45969 | ||
provenance: false | ||
set: | | ||
*.platform=${{ inputs.platforms }} | ||
*.output=type=registry,push-by-digest=true,name-canonical=true | ||
*.cache-to=type=gha,scope=${{ github.workflow }},mode=max | ||
*.cache-from=type=gha,scope=${{ github.workflow }} | ||
files: | | ||
docker-bake.hcl | ||
build.json | ||
- name: Set output variables | ||
id: bake_metadata | ||
run: | | ||
.github/workflows/extract-image-name.sh | tee -a "${GITHUB_OUTPUT}" | ||
env: | ||
BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
name: Docker | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- "**.md" | ||
- ruff.toml | ||
- bumpver.toml | ||
- .pre-commit-config.yaml | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*" | ||
workflow_dispatch: | ||
|
||
# https://docs.github.com/en/actions/using-jobs/using-concurrency | ||
concurrency: | ||
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
|
||
build-amd64: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
runsOn: ubuntu-22.04 | ||
platforms: linux/amd64 | ||
|
||
test-amd64: | ||
needs: build-amd64 | ||
strategy: | ||
fail-fast: false | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
runsOn: ubuntu-22.04 | ||
image: ${{ needs.build-amd64.outputs.image }} | ||
integration: false | ||
|
||
build: | ||
needs: test-amd64 | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
runsOn: ubuntu-22.04 | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
# To save arm64 runner resources, we run the tests only on main | ||
# and only for full-stack image (same for integration tests below). | ||
test-arm64: | ||
if: >- | ||
github.repository == 'cnts4sci/build-machine' | ||
&& (github.ref_type == 'tag' || github.ref_name == 'main') | ||
needs: build | ||
uses: ./.github/workflows/test.yml | ||
with: | ||
runsOn: buildjet-4vcpu-ubuntu-2204-arm | ||
image: ${{ needs.build.outputs.image }} | ||
integration: false | ||
|
||
test-integration: | ||
name: Integration tests | ||
needs: build | ||
strategy: | ||
fail-fast: false | ||
# Trick to exclude arm64 tests from PRs | ||
# https://github.com/orgs/community/discussions/26253 | ||
matrix: | ||
runner: [ubuntu-22.04, buildjet-4vcpu-ubuntu-2204-arm] | ||
isPR: | ||
- ${{ github.event_name == 'pull_request' }} | ||
exclude: | ||
- isPR: true | ||
runner: buildjet-4vcpu-ubuntu-2204-arm | ||
|
||
uses: ./.github/workflows/test.yml | ||
with: | ||
runsOn: ${{ matrix.runner }} | ||
image: ${{ needs.build.outputs.image }} | ||
integration: true | ||
|
||
publish-ghcr: | ||
needs: [build, test-amd64] | ||
uses: ./.github/workflows/publish.yml | ||
with: | ||
runsOn: ubuntu-22.04 | ||
image: ${{ needs.build.outputs.image }} | ||
registry: ghcr.io | ||
secrets: inherit | ||
|
Oops, something went wrong.