I’m trying to setup GitHub actions for a Python package. I believe the most sane way to do so is what I’m used to from GitLab; run a set of commands inside of a docker image. I would like to use a matrix to test multiple Python versions.
So far I have defined the following workflow:
name: Pytest
on:
- push
- pull_request
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.5
- 3.6
- 3.7
- 3.8
container: python:${{ python-version }}-alpine
steps:
- uses: actions/checkout@v2
- name: Install
run: |
pip install poetry
poetry install
- name: PyTest
run: poetry run pytest
The result can be seen here: https://github.com/remcohaszing/pywakeonlan/actions/runs/87630190
This shows the following error:
The workflow is not valid. .github/workflows/pytest.yaml (Line: 17, Col: 16): Unrecognized named-value: 'python-version'. Located at position 1 within expression: python-version
How do I fix this workflow?