mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
ci: buildkit integration test
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
fda0226a89
commit
32f0561715
2 changed files with 96 additions and 0 deletions
72
.github/workflows/ci.yml
vendored
72
.github/workflows/ci.yml
vendored
|
@ -36,6 +36,9 @@ jobs:
|
|||
uses: docker/bake-action@v1
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
set: |
|
||||
*.cache-from=type=gha,scope=build-${{ matrix.target }}
|
||||
*.cache-to=type=gha,scope=build-${{ matrix.target }}
|
||||
-
|
||||
name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
|
@ -43,3 +46,72 @@ jobs:
|
|||
name: ${{ matrix.target }}
|
||||
path: ${{ env.BUNDLES_OUTPUT }}/${{ matrix.target }}-daemon/*
|
||||
if-no-files-found: error
|
||||
|
||||
test-buildkit:
|
||||
needs:
|
||||
- build
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
pkg:
|
||||
- ./client
|
||||
- ./cmd/buildctl
|
||||
- ./solver
|
||||
- ./frontend
|
||||
- ./frontend/dockerfile
|
||||
typ:
|
||||
- integration
|
||||
include:
|
||||
- pkg: ./...
|
||||
skip-integration-tests: 1
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: moby
|
||||
-
|
||||
name: BuildKit ref
|
||||
run: |
|
||||
./hack/go-mod-prepare.sh
|
||||
echo "BUILDKIT_REF=$(./hack/buildkit-ref)" >> $GITHUB_ENV
|
||||
working-directory: moby
|
||||
-
|
||||
name: Checkout BuildKit ${{ env.BUILDKIT_REF }}
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: "moby/buildkit"
|
||||
ref: ${{ env.BUILDKIT_REF }}
|
||||
path: buildkit
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
-
|
||||
name: Download build artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: binary
|
||||
path: ./buildkit/build/moby/
|
||||
-
|
||||
name: Update daemon.json
|
||||
run: |
|
||||
sudo rm /etc/docker/daemon.json
|
||||
sudo service docker restart
|
||||
docker version
|
||||
docker info
|
||||
-
|
||||
name: Test
|
||||
run: |
|
||||
./hack/test ${{ matrix.typ }}
|
||||
env:
|
||||
CONTEXT: "."
|
||||
TEST_DOCKERD: "1"
|
||||
TEST_DOCKERD_BINARY: "./build/moby/dockerd"
|
||||
TESTPKGS: "${{ matrix.pkg }}"
|
||||
TESTFLAGS: "-v --parallel=1 --timeout=30m --run=//worker=dockerd$"
|
||||
SKIP_INTEGRATION_TESTS: "${{ matrix.skip-integration-tests }}"
|
||||
working-directory: buildkit
|
||||
|
|
24
hack/buildkit-ref
Executable file
24
hack/buildkit-ref
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
# This script returns the current BuildKit ref being used in moby.
|
||||
|
||||
: "${BUILDKIT_REPO=moby/buildkit}"
|
||||
: "${BUILDKIT_REF=}"
|
||||
|
||||
if [ -n "$BUILDKIT_REF" ]; then
|
||||
echo "$BUILDKIT_REF"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# prepare go mod
|
||||
./hack/go-mod-prepare.sh
|
||||
|
||||
# get buildkit version from vendor.mod
|
||||
BUILDKIT_REF=$(GO111MODULE=on go list -mod=mod -modfile=vendor.mod -u -m -f '{{.Version}}' "github.com/${BUILDKIT_REPO}")
|
||||
if [[ "${BUILDKIT_REF}" == *-*-* ]]; then
|
||||
# if pseudo-version, figure out just the uncommon sha (https://github.com/golang/go/issues/34745)
|
||||
BUILDKIT_REF=$(echo "${BUILDKIT_REF}" | awk -F"-" '{print $NF}' | awk 'BEGIN{FIELDWIDTHS="7"} {print $1}')
|
||||
# use github api to return full sha to be able to use it as ref
|
||||
BUILDKIT_REF=$(curl -s "https://api.github.com/repos/${BUILDKIT_REPO}/commits/${BUILDKIT_REF}" | jq -r .sha)
|
||||
fi
|
||||
|
||||
echo "$BUILDKIT_REF"
|
Loading…
Add table
Reference in a new issue