Skip to content

Commit 4abaad3

Browse files
committed
ci: move frontend integration tests and build to a dedicated workflow
Split dockerfile frontend integration tests and build in a dedicated workflow so we have a clear separation of concerns and also avoid building the frontend when a BuildKit tag is pushed and vice versa with a dockerfile tag. Signed-off-by: CrazyMax <[email protected]>
1 parent 0ad8d61 commit 4abaad3

File tree

2 files changed

+239
-94
lines changed

2 files changed

+239
-94
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ concurrency:
66

77
on:
88
schedule:
9-
- cron: '0 10 * * *' # everyday at 10am
9+
- cron: '0 10 * * *'
1010
workflow_dispatch:
1111
push:
1212
branches:
1313
- 'master'
1414
tags:
1515
- 'v*'
16-
- 'dockerfile/*'
1716
pull_request:
1817
paths-ignore:
1918
- 'README.md'
@@ -23,9 +22,8 @@ on:
2322
env:
2423
REPO_SLUG_ORIGIN: "moby/buildkit:latest"
2524
REPO_SLUG_TARGET: "moby/buildkit"
26-
DF_REPO_SLUG_TARGET: "docker/dockerfile-upstream"
2725
PLATFORMS: "linux/amd64,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le,linux/riscv64"
28-
CACHE_GHA_SCOPE_IT: "integration-tests"
26+
CACHE_GHA_SCOPE_IT: "build-integration-tests"
2927
CACHE_GHA_SCOPE_BINARIES: "binaries"
3028
CACHE_GHA_SCOPE_CROSS: "cross"
3129
TESTFLAGS: "-v --parallel=6 --timeout=30m"
@@ -69,13 +67,13 @@ jobs:
6967

7068
test:
7169
runs-on: ubuntu-20.04
72-
needs: [base]
70+
needs:
71+
- base
7372
strategy:
7473
fail-fast: false
7574
matrix:
7675
pkg:
7776
- ./client ./cmd/buildctl ./worker/containerd ./solver ./frontend
78-
- ./frontend/dockerfile
7977
worker:
8078
- containerd
8179
- containerd-rootless
@@ -86,12 +84,8 @@ jobs:
8684
- oci-snapshotter-stargz
8785
typ:
8886
- integration
89-
- dockerfile
9087
tags:
9188
- ''
92-
exclude:
93-
- pkg: ./client ./cmd/buildctl ./worker/containerd ./solver ./frontend
94-
typ: dockerfile
9589
include:
9690
- pkg: ./...
9791
skip-integration-tests: 1
@@ -142,7 +136,7 @@ jobs:
142136
TEST_COVERAGE: 1
143137
TESTPKGS: ${{ matrix.pkg }}
144138
SKIP_INTEGRATION_TESTS: ${{ matrix.skip-integration-tests }}
145-
CACHE_FROM: type=gha,scope=${{ env.CACHE_GHA_SCOPE_IT }} type=gha,scope=${{ env.CACHE_GHA_SCOPE_BINARIES }}
139+
CACHE_FROM: type=gha,scope=${{ env.CACHE_GHA_SCOPE_IT }}
146140
-
147141
name: Upload coverage file
148142
continue-on-error: ${{ matrix.tags == 'nydus' }}
@@ -192,7 +186,9 @@ jobs:
192186

193187
upload-coverage:
194188
runs-on: ubuntu-20.04
195-
needs: [test, test-os]
189+
needs:
190+
- test
191+
- test-os
196192
steps:
197193
-
198194
name: Checkout
@@ -275,7 +271,10 @@ jobs:
275271
276272
image:
277273
runs-on: ubuntu-20.04
278-
needs: [release-base, test, cross]
274+
needs:
275+
- release-base
276+
- test
277+
- cross
279278
strategy:
280279
fail-fast: false
281280
matrix:
@@ -318,7 +317,10 @@ jobs:
318317

319318
binaries:
320319
runs-on: ubuntu-20.04
321-
needs: [release-base, test, cross]
320+
needs:
321+
- release-base
322+
- test
323+
- cross
322324
steps:
323325
-
324326
name: Checkout
@@ -361,83 +363,3 @@ jobs:
361363
draft: true
362364
files: ./release-out/*
363365
name: ${{ needs.release-base.outputs.tag }}
364-
365-
frontend-base:
366-
runs-on: ubuntu-20.04
367-
if: github.event_name != 'schedule'
368-
outputs:
369-
typ: ${{ steps.prep.outputs.typ }}
370-
push: ${{ steps.prep.outputs.push }}
371-
matrix: ${{ steps.prep.outputs.matrix }}
372-
steps:
373-
-
374-
name: Prepare
375-
id: prep
376-
run: |
377-
TYP=master
378-
TAG=mainline
379-
PUSH=false
380-
if [[ $GITHUB_REF == refs/tags/dockerfile/* ]]; then
381-
TYP=tag
382-
TAG=${GITHUB_REF#refs/tags/}
383-
PUSH=push
384-
elif [[ $GITHUB_REF == refs/heads/* ]]; then
385-
PUSH=push
386-
fi
387-
echo "typ=${TYP}" >>${GITHUB_OUTPUT}
388-
echo "push=${PUSH}" >>${GITHUB_OUTPUT}
389-
if [ "${TYP}" = "master" ]; then
390-
echo "matrix=$(jq -cn --arg tag "$TAG" '[$tag, "labs"]')" >>${GITHUB_OUTPUT}
391-
else
392-
echo "matrix=$(jq -cn --arg tag "$TAG" '[$tag]')" >>${GITHUB_OUTPUT}
393-
fi
394-
395-
frontend-image:
396-
runs-on: ubuntu-20.04
397-
if: github.event_name != 'schedule'
398-
needs: [frontend-base, test]
399-
strategy:
400-
fail-fast: false
401-
matrix:
402-
tag: ${{ fromJson(needs.frontend-base.outputs.matrix) }}
403-
steps:
404-
-
405-
name: Prepare
406-
run: |
407-
if [ "${{ matrix.tag }}" = "labs" ]; then
408-
echo "CACHE_SCOPE=frontend-labs" >>${GITHUB_ENV}
409-
else
410-
echo "CACHE_SCOPE=frontend-mainline" >>${GITHUB_ENV}
411-
fi
412-
-
413-
name: Checkout
414-
uses: actions/checkout@v3
415-
-
416-
name: Expose GitHub Runtime
417-
uses: crazy-max/ghaction-github-runtime@v2
418-
-
419-
name: Set up QEMU
420-
uses: docker/setup-qemu-action@v2
421-
-
422-
name: Set up Docker Buildx
423-
uses: docker/setup-buildx-action@v2
424-
with:
425-
version: ${{ env.BUILDX_VERSION }}
426-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
427-
buildkitd-flags: --debug
428-
-
429-
name: Login to DockerHub
430-
uses: docker/login-action@v2
431-
if: needs.frontend-base.outputs.push == 'push'
432-
with:
433-
username: ${{ secrets.DOCKERHUB_USERNAME }}
434-
password: ${{ secrets.DOCKERHUB_TOKEN }}
435-
-
436-
name: Build
437-
run: |
438-
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release "${{ needs.frontend-base.outputs.typ }}" "${{ matrix.tag }}" "$DF_REPO_SLUG_TARGET" "${{ needs.frontend-base.outputs.push }}"
439-
env:
440-
RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
441-
PLATFORMS: ${{ env.PLATFORMS }},linux/386,linux/mips,linux/mipsle,linux/mips64,linux/mips64le
442-
CACHE_FROM: type=gha,scope=${{ env.CACHE_SCOPE }}
443-
CACHE_TO: type=gha,scope=${{ env.CACHE_SCOPE }}

0 commit comments

Comments
 (0)