mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-07 08:24:23 +01:00
Since we are using this to exercise any changes to osbuilder or packaging scripts, let's make sure that we only run the test in that case. Similarly, don't run for every single push. Just run this workflow for pull requests. Fixes: #3594 Signed-off-by: Eric Ernst <eric_ernst@apple.com>
87 lines
2.5 KiB
YAML
87 lines
2.5 KiB
YAML
name: kata deploy build
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- edited
|
|
- reopened
|
|
- synchronize
|
|
- labeled
|
|
- unlabeled
|
|
paths:
|
|
- tools/**
|
|
- versions.yaml
|
|
|
|
jobs:
|
|
build-asset:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
asset:
|
|
- kernel
|
|
- kernel-experimental
|
|
- shim-v2
|
|
- qemu
|
|
- cloud-hypervisor
|
|
- firecracker
|
|
- rootfs-image
|
|
- rootfs-initrd
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install docker
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
|
run: |
|
|
curl -fsSL https://test.docker.com -o test-docker.sh
|
|
sh test-docker.sh
|
|
|
|
- name: Build ${{ matrix.asset }}
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
|
run: |
|
|
make "${KATA_ASSET}-tarball"
|
|
build_dir=$(readlink -f build)
|
|
# store-artifact does not work with symlink
|
|
sudo cp -r --preserve=all "${build_dir}" "kata-build"
|
|
env:
|
|
KATA_ASSET: ${{ matrix.asset }}
|
|
|
|
- name: store-artifact ${{ matrix.asset }}
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: kata-artifacts
|
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
|
if-no-files-found: error
|
|
|
|
create-kata-tarball:
|
|
runs-on: ubuntu-latest
|
|
needs: build-asset
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: get-artifacts
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: kata-artifacts
|
|
path: build
|
|
- name: merge-artifacts
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
|
run: |
|
|
make merge-builds
|
|
- name: store-artifacts
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: kata-static-tarball
|
|
path: kata-static.tar.xz
|
|
|
|
make-kata-tarball:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: make kata-tarball
|
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') }}
|
|
run: |
|
|
make kata-tarball
|
|
sudo make install-tarball
|