如何在 Github Actions 上使用容器设置构建矩阵

Ram*_*ros 7 github-actions

我想针对不能作为 GA runners 的发行版运行测试。就我而言,容器很好。

我如何用容器描述构建矩阵?

Ram*_*ros 10

这是使用四个不同 docker 镜像的示例

name: ci

jobs:
  job:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        container: ["ubuntu:bionic", "fedora:31", "opensuse/leap:42.3", "centos8"]

    container:
      image: ${{ matrix.container }}

    steps:
      - name: checkout
        uses: actions/checkout@v1
Run Code Online (Sandbox Code Playgroud)