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

[GitHub Actions (new)] [BUG] Unable to create environment variables based matrix

Solved! Go to Solution.

Here's what I'm trying:

 

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version:
        - 3.7
        os:
        - ubuntu-18.04
        env:
        - TOXENV: python,check-docs,build-docs
- TOXENV: build-dists,pre-commit-ci

 

 

I want to generate a number of jobs from matrix also taking into account the specified env vars. Just like Travis CI does:

 

Anything I'm missing?

3 Replies
Community Manager
Message 2 of 4

Re: [GitHub Actions] (new) Unable to create environment variables based matrix

Hi @webknjaz, thanks for being here! Did you give this workflow a go? Are you having any problems?


Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Pilot Lvl 1
Message 3 of 4

Re: [GitHub Actions] (new) Unable to create environment variables based matrix

Hi @AndreaGriffiths11, I tried it and it doesn't create jobs with different env var values from the matrix.

Solution
Pilot Lvl 1
Message 4 of 4

Re: [GitHub Actions (new)] [BUG] Unable to create environment variables based matrix

Workaround is to explicitly apply the env factor on a job level:

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version:
        - 3.7
        os:
        - ubuntu-18.04
        env:
        - TOXENV: python,check-docs,build-docs
- TOXENV: build-dists,pre-commit-ci
steps:
- ...
- run: |
some-command --with-access-to=env
env: ${{ matrix.env }}