name: ci on: schedule: - cron: '0 10 * * *' push: branches: - 'master' - 'releases/v*' tags: - 'v*' pull_request: jobs: main: runs-on: ubuntu-latest strategy: fail-fast: false matrix: buildx-version: - "" - "latest" - "v0.4.1" - "lab:latest" - "lab:v0.11.2-desktop.2" steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Docker Buildx id: buildx uses: ./ with: version: ${{ matrix.buildx-version }} - name: Nodes output run: | cat << EOF ${{ steps.buildx.outputs.nodes }} EOF multi: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Docker Buildx 1 uses: ./ - name: Set up Docker Buildx 2 uses: ./ error: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Stop docker run: | sudo systemctl stop docker docker.socket - name: Set up Docker Buildx id: buildx continue-on-error: true uses: ./ - name: Check run: | echo "${{ toJson(steps.buildx) }}" if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then echo "::error::Should have failed" exit 1 fi - name: Dump context if: always() uses: crazy-max/ghaction-dump-context@v2 debug: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Create Dockerfile run: | cat > ./Dockerfile <- --privileged --health-cmd "docker info" --health-interval 10s --health-timeout 5s --health-retries 5 env: DOCKER_TLS_CERTDIR: "" ports: - 2375:2375 steps: - name: Checkout uses: actions/checkout@v4 - name: Create context run: | docker context create mycontext --docker host=tcp://127.0.0.1:2375 - name: Check context run: | docker --context mycontext info - name: Set up Docker Buildx uses: ./ with: endpoint: mycontext env: DOCKER_CONTEXT: mycontext config: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Create buildkitd conf run: | cat > /tmp/buildkitd.toml < ./Dockerfile < ./Dockerfile < ./Dockerfile </dev/null 2>&1; then sudo dpkg -r --force-depends docker-ce-cli docker-buildx-plugin else sudo apt-get purge -y moby-cli moby-buildx fi - name: Set up Docker Buildx uses: ./ - name: Create Dockerfile run: | cat > ./Dockerfile </dev/null 2>&1; then sudo dpkg -r --force-depends docker-ce-cli docker-buildx-plugin else sudo apt-get purge -y moby-cli moby-buildx fi - name: Set up Docker Buildx uses: ./ with: version: ${{ matrix.buildx-version }} - name: Create Dockerfile run: | cat > ./Dockerfile </dev/null 2>&1; then sudo dpkg -r --force-depends docker-ce-cli docker-buildx-plugin else sudo apt-get purge -y moby-cli moby-buildx fi - name: Set up Docker Buildx id: buildx continue-on-error: true uses: ./ with: install: true - name: Check run: | echo "${{ toJson(steps.buildx) }}" if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then echo "::error::Should have failed" exit 1 fi append: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Create dummy contexts run: | docker context create ctxbuilder2 docker context create ctxbuilder3 - name: Set up Docker Buildx id: buildx uses: ./ with: append: | - name: builder2 endpoint: ctxbuilder2 platforms: linux/amd64 driver-opts: - image=moby/buildkit:master - network=host - endpoint: ctxbuilder3 platforms: linux/arm64 - name: List builder platforms run: echo ${{ steps.buildx.outputs.platforms }} platforms: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: ./ with: platforms: linux/amd64 docker-context: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Create Docker context run: | docker context create foo docker context use foo - name: Set up Docker Buildx uses: ./ with: driver: docker cleanup: runs-on: ubuntu-latest strategy: fail-fast: false matrix: cleanup: - true - false steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Docker Buildx uses: ./ with: cleanup: ${{ matrix.cleanup }} k3s: runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: version: - v0.11.0 - v0.10.5 steps: - name: Checkout uses: actions/checkout@v4 - name: Install k3s uses: crazy-max/.github/.github/actions/install-k3s@605d30d5ae97f6680578ace4b56645af79343e60 with: version: "v1.21.2-k3s1" - name: Set up Docker Buildx id: buildx uses: ./ with: version: ${{ matrix.version }} driver: kubernetes platforms: linux/amd64 driver-opts: | image=moby/buildkit:buildx-stable-1 qemu.install=true append: | - platforms: linux/arm64 driver-opts: - image=moby/buildkit:buildx-stable-1 - qemu.install=true - platforms: linux/s390x driver-opts: - image=moby/buildkit:buildx-stable-1 - qemu.install=true - name: Create Dockerfile run: | cat > ./Dockerfile <