Multiple builds with different environments variables but not as a matrix

I have this Travis configuration for a Python/Plone project:

https://github.com/zopyx/xmldirector.connector/blob/master/.travis.yml#L15-L54

This can not be directly expressed as matrix because I want to test only a subset of options that would a matrix give me. So for a number of hand-crafted configurations (expressed through a bunch of environment variables) I want to configure my actions workflow.

How can I do that with Github actions?

I took your .travis.yml and did a quick edit.

matrix-env:
  runs-on: ubuntu-latest
  strategy:
   matrix:
    env:
    - { TYPE: OWNCLOUD, PLONE_VERSION: 5.2, DOCKER: "pschmitt/owncloud", DOCKER_OPTIONS: "-p 127.0.0.1:8080:80", CONNECTOR_URL: "webdav://localhost:8080/remote.php/webdav", CONNECTOR_USERNAME: "admin", CONNECTOR_PASSWORD: "changeme" }
    - { TYPE: LOCAL_FS, PLONE_VERSION: 5.2, CONNECTOR_URL: "file:///tmp/testing" }
  env: ${{ matrix.env }}
  steps:
  - run: echo "Check Run->env"

It should work as you need. Each line inside strategy.matrix.env creates a job with selected env vars.

What is missing is different python versions (which could be passed as yet another variable). I have very little experience with python in Actions so no idea how to select different versions… but (i hope) at least matrix itself won’t be a problem.

1 Like