2022-08-29 20:52:29 +00:00
|
|
|
name: buildkit
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2023-02-07 17:29:44 +00:00
|
|
|
- '[0-9]+.[0-9]+'
|
2022-08-29 20:52:29 +00:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
2024-01-10 08:46:37 +00:00
|
|
|
GO_VERSION: "1.21.6"
|
2022-12-26 16:45:50 +00:00
|
|
|
DESTDIR: ./build
|
2022-08-29 20:52:29 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-09-10 13:07:46 +00:00
|
|
|
validate-dco:
|
|
|
|
uses: ./.github/workflows/.dco.yml
|
|
|
|
|
2022-08-29 20:52:29 +00:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-20.04
|
2022-09-10 13:07:46 +00:00
|
|
|
needs:
|
|
|
|
- validate-dco
|
2022-08-29 20:52:29 +00:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2024-01-30 12:28:43 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-08-29 20:52:29 +00:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2024-01-30 12:42:26 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-29 20:52:29 +00:00
|
|
|
-
|
|
|
|
name: Build
|
2024-01-30 12:45:04 +00:00
|
|
|
uses: docker/bake-action@v4
|
2022-08-29 20:52:29 +00:00
|
|
|
with:
|
|
|
|
targets: binary
|
|
|
|
-
|
|
|
|
name: Upload artifacts
|
2024-01-31 14:39:13 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-08-29 20:52:29 +00:00
|
|
|
with:
|
|
|
|
name: binary
|
2022-12-26 16:45:50 +00:00
|
|
|
path: ${{ env.DESTDIR }}
|
2022-08-29 20:52:29 +00:00
|
|
|
if-no-files-found: error
|
|
|
|
retention-days: 1
|
|
|
|
|
|
|
|
test:
|
2022-11-25 21:57:57 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
timeout-minutes: 120
|
2022-08-29 20:52:29 +00:00
|
|
|
needs:
|
|
|
|
- build
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-02-02 21:01:11 +00:00
|
|
|
worker:
|
|
|
|
- dockerd
|
|
|
|
- dockerd-containerd
|
2022-08-29 20:52:29 +00:00
|
|
|
pkg:
|
2022-10-20 21:18:44 +00:00
|
|
|
- client
|
|
|
|
- cmd/buildctl
|
|
|
|
- solver
|
|
|
|
- frontend
|
|
|
|
- frontend/dockerfile
|
2022-08-29 20:52:29 +00:00
|
|
|
typ:
|
|
|
|
- integration
|
|
|
|
steps:
|
2023-02-02 21:01:11 +00:00
|
|
|
-
|
|
|
|
name: Prepare
|
|
|
|
run: |
|
|
|
|
disabledFeatures="cache_backend_azblob,cache_backend_s3"
|
2023-03-16 14:25:00 +00:00
|
|
|
if [ "${{ matrix.worker }}" = "dockerd" ]; then
|
|
|
|
disabledFeatures="${disabledFeatures},merge_diff"
|
|
|
|
fi
|
2023-02-02 21:01:11 +00:00
|
|
|
echo "BUILDKIT_TEST_DISABLE_FEATURES=${disabledFeatures}" >> $GITHUB_ENV
|
2023-08-01 11:40:34 +00:00
|
|
|
# Expose `ACTIONS_RUNTIME_TOKEN` and `ACTIONS_CACHE_URL`, which is used
|
|
|
|
# in BuildKit's test suite to skip/unskip cache exporters:
|
|
|
|
# https://github.com/moby/buildkit/blob/567a99433ca23402d5e9b9f9124005d2e59b8861/client/client_test.go#L5407-L5411
|
|
|
|
-
|
|
|
|
name: Expose GitHub Runtime
|
2024-01-30 13:01:15 +00:00
|
|
|
uses: crazy-max/ghaction-github-runtime@v3
|
2022-08-29 20:52:29 +00:00
|
|
|
-
|
|
|
|
name: Checkout
|
2024-01-30 12:28:43 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-08-29 20:52:29 +00:00
|
|
|
with:
|
|
|
|
path: moby
|
|
|
|
-
|
|
|
|
name: BuildKit ref
|
|
|
|
run: |
|
2023-07-17 13:15:57 +00:00
|
|
|
echo "$(./hack/buildkit-ref)" >> $GITHUB_ENV
|
2022-08-29 20:52:29 +00:00
|
|
|
working-directory: moby
|
|
|
|
-
|
|
|
|
name: Checkout BuildKit ${{ env.BUILDKIT_REF }}
|
2024-01-30 12:28:43 +00:00
|
|
|
uses: actions/checkout@v4
|
2022-08-29 20:52:29 +00:00
|
|
|
with:
|
2023-02-02 07:08:48 +00:00
|
|
|
repository: ${{ env.BUILDKIT_REPO }}
|
2022-08-29 20:52:29 +00:00
|
|
|
ref: ${{ env.BUILDKIT_REF }}
|
|
|
|
path: buildkit
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2024-01-30 12:55:28 +00:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-08-29 20:52:29 +00:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2024-01-30 12:42:26 +00:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-08-29 20:52:29 +00:00
|
|
|
-
|
|
|
|
name: Download binary artifacts
|
2024-01-31 14:39:13 +00:00
|
|
|
uses: actions/download-artifact@v4
|
2022-08-29 20:52:29 +00:00
|
|
|
with:
|
|
|
|
name: binary
|
|
|
|
path: ./buildkit/build/moby/
|
|
|
|
-
|
|
|
|
name: Update daemon.json
|
|
|
|
run: |
|
2023-06-29 23:50:42 +00:00
|
|
|
sudo rm -f /etc/docker/daemon.json
|
2022-08-29 20:52:29 +00:00
|
|
|
sudo service docker restart
|
|
|
|
docker version
|
|
|
|
docker info
|
|
|
|
-
|
|
|
|
name: Test
|
|
|
|
run: |
|
|
|
|
./hack/test ${{ matrix.typ }}
|
|
|
|
env:
|
|
|
|
CONTEXT: "."
|
|
|
|
TEST_DOCKERD: "1"
|
2022-12-26 16:45:50 +00:00
|
|
|
TEST_DOCKERD_BINARY: "./build/moby/dockerd"
|
2022-10-20 21:18:44 +00:00
|
|
|
TESTPKGS: "./${{ matrix.pkg }}"
|
2023-07-23 22:24:56 +00:00
|
|
|
TESTFLAGS: "-v --parallel=1 --timeout=30m --run=//worker=${{ matrix.worker }}$"
|
2022-08-29 20:52:29 +00:00
|
|
|
working-directory: buildkit
|