github.com/adityamillind98/moby@v23.0.0-rc.4+incompatible/.github/workflows/ci.yml (about)

     1  name: ci
     2  
     3  concurrency:
     4    group: ${{ github.workflow }}-${{ github.ref }}
     5    cancel-in-progress: true
     6  
     7  on:
     8    workflow_dispatch:
     9    push:
    10      branches:
    11        - 'master'
    12        - '[0-9]+.[0-9]+'
    13      tags:
    14        - 'v*'
    15    pull_request:
    16  
    17  env:
    18    DESTDIR: ./build
    19  
    20  jobs:
    21    validate-dco:
    22      uses: ./.github/workflows/.dco.yml
    23  
    24    build:
    25      runs-on: ubuntu-20.04
    26      needs:
    27        - validate-dco
    28      strategy:
    29        fail-fast: false
    30        matrix:
    31          target:
    32            - binary
    33            - dynbinary
    34      steps:
    35        -
    36          name: Checkout
    37          uses: actions/checkout@v3
    38          with:
    39            fetch-depth: 0
    40        -
    41          name: Set up Docker Buildx
    42          uses: docker/setup-buildx-action@v2
    43        -
    44          name: Build
    45          uses: docker/bake-action@v2
    46          with:
    47            targets: ${{ matrix.target }}
    48        -
    49          name: List artifacts
    50          run: |
    51            tree -nh ${{ env.DESTDIR }}
    52        -
    53          name: Check artifacts
    54          run: |
    55            find ${{ env.DESTDIR }} -type f -exec file -e ascii -- {} +
    56        -
    57          name: Upload artifacts
    58          uses: actions/upload-artifact@v3
    59          with:
    60            name: ${{ matrix.target }}
    61            path: ${{ env.DESTDIR }}
    62            if-no-files-found: error
    63            retention-days: 7
    64  
    65    prepare-cross:
    66      runs-on: ubuntu-latest
    67      needs:
    68        - validate-dco
    69      outputs:
    70        matrix: ${{ steps.platforms.outputs.matrix }}
    71      steps:
    72        -
    73          name: Checkout
    74          uses: actions/checkout@v3
    75        -
    76          name: Create matrix
    77          id: platforms
    78          run: |
    79            matrix="$(docker buildx bake binary-cross --print | jq -cr '.target."binary-cross".platforms')"
    80            echo "matrix=$matrix" >> $GITHUB_OUTPUT
    81        -
    82          name: Show matrix
    83          run: |
    84            echo ${{ steps.platforms.outputs.matrix }}
    85  
    86    cross:
    87      runs-on: ubuntu-20.04
    88      needs:
    89        - validate-dco
    90        - prepare-cross
    91      strategy:
    92        fail-fast: false
    93        matrix:
    94          platform: ${{ fromJson(needs.prepare-cross.outputs.matrix) }}
    95      steps:
    96        -
    97          name: Checkout
    98          uses: actions/checkout@v3
    99          with:
   100            fetch-depth: 0
   101        -
   102          name: Prepare
   103          run: |
   104            platform=${{ matrix.platform }}
   105            echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
   106        -
   107          name: Set up Docker Buildx
   108          uses: docker/setup-buildx-action@v2
   109        -
   110          name: Build
   111          uses: docker/bake-action@v2
   112          with:
   113            targets: all
   114            set: |
   115              *.platform=${{ matrix.platform }}
   116        -
   117          name: List artifacts
   118          run: |
   119            tree -nh ${{ env.DESTDIR }}
   120        -
   121          name: Check artifacts
   122          run: |
   123            find ${{ env.DESTDIR }} -type f -exec file -e ascii -- {} +
   124        -
   125          name: Upload artifacts
   126          uses: actions/upload-artifact@v3
   127          with:
   128            name: cross-${{ env.PLATFORM_PAIR }}
   129            path: ${{ env.DESTDIR }}
   130            if-no-files-found: error
   131            retention-days: 7