Pin the Python version to 3.8 #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Unit Tests" | |
on: | |
pull_request: {} | |
push: | |
branches: ["main"] | |
env: | |
PYTHON_VERSION: "3.10" | |
jobs: | |
test: | |
name: Pytest | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
uses: ./.github/actions/install-dependencies | |
with: | |
requirements: "true" | |
test-requirements: "true" | |
- name: Run pytest | |
run: pytest --cov deploy tests/test_insert_rows.py --cov-report xml:coverage-${{ env.PYTHON_VERSION }}.xml --junitxml=test-results-${{ env.PYTHON_VERSION }}.xml | |
- name: Upload pytest test results artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pytest-results-${{ env.PYTHON_VERSION }} | |
path: test-results-${{ env.PYTHON_VERSION }}.xml | |
# Use always() to always run this step to publish test results when there are test failures | |
if: ${{ always() }} | |
- name: Upload coverage results artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pytest-coverage-${{ env.PYTHON_VERSION }} | |
path: coverage-${{ env.PYTHON_VERSION }}.xml | |
# Use always() to always run this step to publish test results when there are test failures | |
if: ${{ always() }} |