workflows/manually_compile_check_image: refactor with job matrix
@@ -5,79 +5,14 @@ on: [workflow_dispatch]
jobs:
generate-centos-image:
- # GitHub Actions doesn't have CentOS VM provided
- runs-on: ubuntu-18.04
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
-
- # Because "Build and push" step `context` field can't be subdir,
- # we need to copy files needed by dockerfile to root dir of the project
- - name: Copy context for docker build
- run: |
- cp -r .github/workflows/docker .
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- - name: Login to DockerHub
- uses: docker/login-action@v1
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
-
- - name: Build and push
- uses: docker/build-push-action@v2
- with:
- context: .
- file: ./docker/Dockerfile-compilation-testing-centos8.2
- platforms: linux/amd64
- push: true
- tags: runetest/compilation-testing:centos8.2
+ # Run all steps in the compilation testing containers
+ strategy:
+ matrix:
+ os: [ubuntu18.04, centos8.2, alinux2]
- generate-ubuntu-image:
# GitHub Actions doesn't have CentOS VM provided
runs-on: ubuntu-18.04
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
-
- # Because "Build and push" step `context` field can't be subdir,
- # we need to copy files needed by dockerfile to root dir of the project
- - name: Copy context for docker build
- run: |
- cp -r .github/workflows/docker .
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- - name: Login to DockerHub
- uses: docker/login-action@v1
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
-
- - name: Build and push
- uses: docker/build-push-action@v2
- with:
- context: .
- file: ./docker/Dockerfile-compilation-testing-ubuntu18.04
- platforms: linux/amd64
- push: true
- tags: runetest/compilation-testing:ubuntu18.04
-
- generate-alinux-image:
- # Run on self-hosted runner on alibaba cloud
- runs-on: [self-hosted, SGX2]
-
steps:
- name: Checkout code
uses: actions/checkout@v2
@@ -98,7 +33,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
- file: ./docker/Dockerfile-compilation-testing-alinux2
+ file: ./docker/Dockerfile-compilation-testing-${{ matrix.os }}
platforms: linux/amd64
push: true
- tags: runetest/compilation-testing:alinux2
+ tags: runetest/compilation-testing:${{ matrix.os }}
