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

refactor(ci): combine Gentoo with other docker tests #1620

Merged
merged 10 commits into from
Oct 10, 2024
51 changes: 18 additions & 33 deletions .github/workflows/validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
dependencies: ${{ steps.filter.outputs.dependencies }}
docker: ${{ steps.filter.outputs.docker }}
docker-files: ${{ steps.filter.outputs.docker_files }}
docker-gentoo: ${{ steps.filter.outputs.docker-gentoo }}
markdown: ${{ steps.filter.outputs.markdown }}
helpers: ${{ steps.filter.outputs.helpers }}
shell: ${{ steps.filter.outputs.shell }}
Expand Down Expand Up @@ -417,6 +416,7 @@ jobs:
fail-fast: false
matrix:
include:
- { container: Gentoo, dockerfile: Dockerfile_gentoo }
- { container: Alpine, dockerfile: Dockerfile_alpine }
- { container: Amazon Linux, dockerfile: Dockerfile_amazonlinux }
- { container: Arch, dockerfile: Dockerfile_archlinux }
Expand All @@ -438,39 +438,24 @@ jobs:
run: grep 'VERSION\|ID' /etc/os-release && uname -a
- name: Build the ${{ matrix.container }} docker image
if: >-
needs.changes.outputs.ci == 'true' ||
needs.changes.outputs.dependencies == 'true' ||
contains(needs.changes.outputs.docker-files, matrix.dockerfile) ||
needs.changes.outputs.shell == 'true'
uses: docker/build-push-action@v6
timeout-minutes: 100
with:
build-args: NODEBUILDER_VERSION=${{ github.sha || github.head_ref || 'master' }}
context: .
file: docker/${{ matrix.dockerfile }}

run-nodebuilder-gentoo:
name: Docker image for ${{ matrix.container }}
needs: [changes, dockerfile-lint, shell-lint, yaml-lint]
if: >-
needs.changes.outputs.docker-gentoo == 'true' ||
( github.event.action == '' &&
github.event.before == '' &&
github.event.inputs == null )
runs-on: ubuntu-latest
strategy:
matrix:
container: [Gentoo]
include:
- container: Gentoo
dockerfile: Dockerfile_gentoo
steps:
- uses: actions/checkout@v4
- name: Check the current OS version
run: grep 'VERSION\|ID' /etc/os-release && uname -a
- name: Build the ${{ matrix.container }} docker image
timeout-minutes: 200
(
needs.changes.outputs.ci == 'true' ||
needs.changes.outputs.dependencies == 'true' ||
contains(needs.changes.outputs.docker-files, matrix.dockerfile) ||
needs.changes.outputs.shell == 'true'
)
&&
(
matrix.container != 'Gentoo' ||
contains(needs.changes.outputs.docker-files, 'Dockerfile_gentoo') ||
(
github.event.action == '' &&
github.event.before == '' &&
github.event.inputs == null
)
)
uses: docker/build-push-action@v6
timeout-minutes: 300
with:
build-args: NODEBUILDER_VERSION=${{ github.sha || github.head_ref || 'master' }}
context: .
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile_gentoo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
# Gentoo is known for its customization, optimization at the expense of image build time.
# Gentoo is known for its customization, optimization at the expense of image build time.asdf
# This Dockerfile offers a stable base image but takes extra time to compile all dependencies.
FROM gentoo/stage3:latest@sha256:2acd0df1f811a71df73a639fab369d317b8c95717b66204d7e45a3cd1d606ec4

Expand Down
2 changes: 0 additions & 2 deletions resources/config/paths-filter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ dependencies:
- 'resources/dependencies/**'
docker:
- 'docker/Dockerfile*'
docker-gentoo:
- 'docker/Dockerfile_gentoo'
helpers:
- '.github/scripts/**'
markdown:
Expand Down
Loading