From 848280cdc39ae5a8591826c2f396b15eb6fbb31e Mon Sep 17 00:00:00 2001 From: Albert Esteve Date: Wed, 5 Oct 2022 09:53:11 +0200 Subject: [PATCH] ci/container.yml: build also vdsm-test containers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build also vdsm test containers in the weekly build workflow. Add another job to the containers workflow to build and upload test containers in `docker` directory. For test containers, build each distro separately and push it to the same repository with a different tag. Final tree of Vdsm repositories: . └── ovirt/ ├── ovirt-vdsm-network-tests-functional: │ ├── centos-8 │ ├── centos-9 │ └── alma-9 ├── ovirt-vdsm-network-tests-integration: │ ├── centos-8 │ ├── centos-9 │ └── alma-9 ├── ovirt-vdsm-network-tests-unit: │ ├── centos-8 │ ├── centos-9 │ └── alma-9 └── ovirt-test: ├── centos-8 ├── centos-9 └── alma-9 Signed-off-by: Albert Esteve --- .github/workflows/containers.yml | 46 +++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index f872e34c05..38d6a59749 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -13,11 +13,18 @@ env: IMAGE_REGISTRY: quay.io can_push: ${{ github.repository_owner == 'oVirt' }} jobs: - container: + container-network: runs-on: ubuntu-latest strategy: matrix: - container: [ functional, integration, unit ] + distro: [ centos-8, centos-9, alma-9 ] + include: + - directory: docker/network + prefix: ovirt/vdsm-network-tests + container: [ functional, integration, unit ] + - directory: docker + prefix: ovirt/vdsm + container: [ test ] steps: - uses: actions/checkout@v2 - name: Install dependencies @@ -25,15 +32,42 @@ jobs: sudo apt update sudo apt install podman - name: Build container images - working-directory: docker/network - run: make ${{ matrix.container }} + working-directory: ${{ matrix.directory }} + run: make ${{ matrix.distro }} - name: Push to Quay.io if: ${{ env.can_push == 'true' }} id: push-to-quay uses: redhat-actions/push-to-registry@v2 with: - image: ovirt/vdsm-network-tests-${{ matrix.container }} - tags: alma-9 centos-8 centos-9 + image: ${{ matrix.prefix }}-${{ matrix.container }} + tags: ${{ matrix.distro }} + registry: ${{ env.IMAGE_REGISTRY }} + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_TOKEN }} + - name: Print image url + if: ${{ env.can_push == 'true' }} + run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" + container-test: + runs-on: ubuntu-latest + strategy: + matrix: + distro: [ centos-8, centos-9, alma-9 ] + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt update + sudo apt install podman + - name: Build container images + working-directory: docker + run: make ${{ matrix.distro }} + - name: Push to Quay.io + if: ${{ env.can_push == 'true' }} + id: push-to-quay + uses: redhat-actions/push-to-registry@v2 + with: + image: ovirt/vdsm-test + tags: ${{ matrix.distro }} registry: ${{ env.IMAGE_REGISTRY }} username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_TOKEN }}