ci: use matrix in tests workflow to avoid duplication

Use a matrix with the Python version to avoid duplication when testing
different Python versions.
This commit is contained in:
Ana María Martínez Gómez
2020-08-21 14:50:14 +02:00
parent b4fa6fc954
commit ad011b08f6

View File

@@ -40,35 +40,24 @@ jobs:
- name: Run rule linter
run: python scripts/lint.py rules/
tests27:
tests:
name: Tests in ${{ matrix.python }}
runs-on: ubuntu-latest
needs: [code_style, rule_linter]
strategy:
matrix:
include:
- python: 2.7
- python: 3.8
steps:
- name: Checkout capa with submodules
uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python 2.7
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: 2.7
- name: Install capa
run: pip install -e .[dev]
- name: Run tests
run: pytest tests/
tests38:
runs-on: ubuntu-latest
needs: [code_style, rule_linter]
steps:
- name: Checkout capa with submodules
uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: ${{ matrix.python }}
- name: Install capa
run: pip install -e .[dev]
- name: Run tests