Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

Multiple builds with different environments variables but not as a matrix

Solved! Go to Solution.

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?

1 Reply
Solution
Pilot Lvl 2
Message 2 of 2

Re: Multiple builds with different environments variables but not as a matrix

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.