2020-08-18 23:40:31 +08:00
|
|
|
name: ci
|
|
|
|
|
|
|
|
on:
|
2021-04-02 07:19:14 +08:00
|
|
|
schedule:
|
|
|
|
- cron: '0 10 * * *' # everyday at 10am
|
2020-08-18 23:40:31 +08:00
|
|
|
push:
|
|
|
|
branches:
|
2021-04-02 07:19:14 +08:00
|
|
|
- 'master'
|
|
|
|
- 'releases/v*'
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
2020-08-18 23:40:31 +08:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-04-02 07:19:14 +08:00
|
|
|
- 'master'
|
|
|
|
- 'releases/v*'
|
2020-08-18 23:40:31 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
main:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
buildx-version:
|
|
|
|
- latest
|
2021-01-05 02:03:58 +08:00
|
|
|
- v0.4.1
|
2020-08-18 23:40:31 +08:00
|
|
|
- ""
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-19 01:13:18 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-08-18 23:40:31 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
version: ${{ matrix.buildx-version }}
|
|
|
|
-
|
2021-04-24 00:14:38 +08:00
|
|
|
name: Inspect builder
|
|
|
|
run: |
|
|
|
|
echo "Name: ${{ steps.buildx.outputs.name }}"
|
|
|
|
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
|
|
|
|
echo "Status: ${{ steps.buildx.outputs.status }}"
|
|
|
|
echo "Flags: ${{ steps.buildx.outputs.flags }}"
|
|
|
|
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
|
2020-08-18 23:40:31 +08:00
|
|
|
-
|
|
|
|
name: Dump context
|
|
|
|
uses: crazy-max/ghaction-dump-context@v1
|
|
|
|
|
|
|
|
multi:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-19 01:13:18 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-08-18 23:40:31 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx 1
|
|
|
|
id: buildx1
|
|
|
|
uses: ./
|
|
|
|
-
|
2021-04-24 00:14:38 +08:00
|
|
|
name: Inspect builder 1
|
|
|
|
run: |
|
|
|
|
echo "Name: ${{ steps.buildx1.outputs.name }}"
|
|
|
|
echo "Endpoint: ${{ steps.buildx1.outputs.endpoint }}"
|
|
|
|
echo "Status: ${{ steps.buildx1.outputs.status }}"
|
|
|
|
echo "Flags: ${{ steps.buildx1.outputs.flags }}"
|
|
|
|
echo "Platforms: ${{ steps.buildx1.outputs.platforms }}"
|
2020-08-18 23:40:31 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx 2
|
|
|
|
id: buildx2
|
|
|
|
uses: ./
|
|
|
|
-
|
2021-04-24 00:14:38 +08:00
|
|
|
name: Inspect builder 2
|
|
|
|
run: |
|
|
|
|
echo "Name: ${{ steps.buildx2.outputs.name }}"
|
|
|
|
echo "Endpoint: ${{ steps.buildx2.outputs.endpoint }}"
|
|
|
|
echo "Status: ${{ steps.buildx2.outputs.status }}"
|
|
|
|
echo "Flags: ${{ steps.buildx2.outputs.flags }}"
|
|
|
|
echo "Platforms: ${{ steps.buildx2.outputs.platforms }}"
|
2020-08-18 23:40:31 +08:00
|
|
|
|
2021-04-24 04:08:40 +08:00
|
|
|
debug:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Create Dockerfile
|
|
|
|
run: |
|
|
|
|
cat > ./Dockerfile <<EOL
|
|
|
|
FROM alpine
|
|
|
|
RUN uname -a
|
|
|
|
EOL
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
buildkitd-flags: --debug
|
|
|
|
-
|
|
|
|
name: Build
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64,linux/arm64,linux/ppc64le
|
|
|
|
|
2020-08-18 23:40:31 +08:00
|
|
|
install:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-19 01:13:18 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-08-18 23:40:31 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
install: true
|
|
|
|
-
|
|
|
|
name: Check cmd
|
|
|
|
run: |
|
|
|
|
docker build --help
|
|
|
|
|
|
|
|
use:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
use:
|
|
|
|
- true
|
|
|
|
- false
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-19 01:13:18 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-08-18 23:40:31 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
use: ${{ matrix.use }}
|
|
|
|
-
|
|
|
|
name: List builder instances
|
|
|
|
run: docker buildx ls
|
|
|
|
|
|
|
|
driver:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2020-09-03 22:23:15 +08:00
|
|
|
driver-opts:
|
2020-08-18 23:40:31 +08:00
|
|
|
- image=moby/buildkit:latest
|
2020-09-03 22:28:23 +08:00
|
|
|
- |
|
|
|
|
image=moby/buildkit:master
|
|
|
|
network=host
|
2020-08-18 23:40:31 +08:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-19 01:13:18 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-08-18 23:40:31 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
driver: docker-container
|
2020-09-03 22:28:23 +08:00
|
|
|
driver-opts: ${{ matrix.driver-opts }}
|
2020-08-18 23:40:31 +08:00
|
|
|
|
2020-08-27 08:41:25 +08:00
|
|
|
docker-driver:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-19 01:13:18 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-08-27 08:41:25 +08:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: ./
|
|
|
|
id: builder
|
|
|
|
with:
|
|
|
|
driver: docker
|
|
|
|
-
|
|
|
|
name: Verify
|
|
|
|
run: |
|
|
|
|
[[ "${{ steps.builder.outputs.name }}" = "default" ]]
|
|
|
|
docker buildx inspect
|
|
|
|
docker buildx inspect | grep Driver | grep docker
|
|
|
|
docker buildx inspect | grep Status | grep running
|
|
|
|
|
2020-09-08 21:52:09 +08:00
|
|
|
endpoint:
|
2020-09-07 02:11:21 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
|
|
dind:
|
|
|
|
image: docker:dind
|
|
|
|
options: >-
|
|
|
|
--privileged
|
|
|
|
--health-cmd "docker info"
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
env:
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
|
|
|
ports:
|
|
|
|
- 2375:2375
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-19 01:13:18 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-09-07 02:11:21 +08:00
|
|
|
-
|
|
|
|
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:
|
2020-09-08 21:52:09 +08:00
|
|
|
endpoint: mycontext
|
2020-09-07 02:11:21 +08:00
|
|
|
|
2020-08-24 20:07:14 +08:00
|
|
|
with-qemu:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
buildx-version:
|
|
|
|
- latest
|
2021-01-05 02:03:58 +08:00
|
|
|
- v0.4.1
|
2020-08-24 20:07:14 +08:00
|
|
|
- ""
|
|
|
|
qemu-platforms:
|
|
|
|
- all
|
|
|
|
- arm64,riscv64,arm
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-19 01:13:18 +08:00
|
|
|
uses: actions/checkout@v2
|
2020-08-24 20:07:14 +08:00
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2020-09-09 06:21:06 +08:00
|
|
|
uses: docker/setup-qemu-action@v1
|
2020-08-24 20:07:14 +08:00
|
|
|
with:
|
|
|
|
platforms: ${{ matrix.qemu-platforms }}
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
version: ${{ matrix.buildx-version }}
|
|
|
|
-
|
2021-04-24 00:14:38 +08:00
|
|
|
name: Inspect builder
|
|
|
|
run: |
|
|
|
|
echo "Name: ${{ steps.buildx.outputs.name }}"
|
|
|
|
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
|
|
|
|
echo "Status: ${{ steps.buildx.outputs.status }}"
|
|
|
|
echo "Flags: ${{ steps.buildx.outputs.flags }}"
|
|
|
|
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
|