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

huangapple go评论66阅读模式
英文:

How to setup up build matrix with containers on Github Actions

问题

我想针对不可用作GA runners的发行版运行测试。在我的情况下,容器是可以的。

如何描述一个包含容器的构建矩阵?

英文:

I want to run test against distros that are not available as GA runners. In my case, containers are fine.

How I describe a build matrix with containers?

答案1

得分: 9

这里是使用四个不同的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
英文:

Here an example using four different docker images

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

huangapple
  • 本文由 发表于 2020年1月6日 20:58:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/59612558.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定