Hey guys! I recently started using Travis and I have a problem.
I have the following .travis.yml:
language: python
python:
- "3.9.6"
- "3.10.1"
- "3.11.0"
before_install:
- curl -sSL https://install.python-poetry.org | python - --version 1.4.0
install:
- poetry install --no-ansi
script:
- echo "Linter"
- echo "SonarQube"
- echo "pytest"
- echo "mkdocs"
stages:
- name: Staging
if: branch = staging
- name: Production
if: branch = production
jobs:
include:
- stage: Staging
python: "3.9.6"
before_install:
- curl -sSL https://install.python-poetry.org | python - --version 1.4.0
install:
- poetry install --no-ansi
script:
- echo "Staging - script"
- stage: Staging
python: "3.10.1"
before_install:
- curl -sSL https://install.python-poetry.org | python - --version 1.4.0
install:
- poetry install --no-ansi
script:
- echo "Staging - script"
- stage: Production
install:
- echo "Production - installation"
script:
- echo "Production - script"
I want to test my application in the three versions of Python, in addition to running the stages according to the condition (also in the three versions of Python).
With this format, the stage runs in the two versions I mentioned, but it seems kind of redundant to have to create a stage for each version of python. However, it runs the stage first and then the normal test.
How do I fix this?