moby--moby/.github/workflows/ci.yml

102 lines
2.3 KiB
YAML
Raw Normal View History

name: ci
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- 'master'
- '[0-9]+.[0-9]{2}'
tags:
- 'v*'
pull_request:
env:
BUNDLES_OUTPUT: ./bundles
jobs:
build:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target:
- binary
- dynbinary
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
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 artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ${{ env.BUNDLES_OUTPUT }}
if-no-files-found: error
retention-days: 7
cross:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm/v5
- linux/arm/v6
- linux/arm/v7
- linux/arm64
- linux/ppc64le
- linux/s390x
- windows/amd64
- windows/arm64
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
uses: docker/bake-action@v1
with:
targets: cross
set: |
*.cache-from=type=gha,scope=cross-${{ env.PLATFORM_PAIR }}
*.cache-to=type=gha,scope=cross-${{ env.PLATFORM_PAIR }}
env:
DOCKER_CROSSPLATFORMS: ${{ matrix.platform }}
-
name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: cross-${{ env.PLATFORM_PAIR }}
path: ${{ env.BUNDLES_OUTPUT }}
if-no-files-found: error
retention-days: 7