Last active
July 17, 2024 19:57
-
-
Save izikeros/368a82113fdbcb528f6e3b5db6bb4dd3 to your computer and use it in GitHub Desktop.
[Run tests with tox (GitHub action)] GitHub action for running pytest tests with tox, run codecov #action #tox #workflow #pytest #codecov
This file contains hidden or 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: Run Tests with Tox | |
on: | |
push: | |
branches: | |
- '*' # This will trigger the action on push to any branch | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] # Adjust these versions as needed | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox tox-gh-actions | |
- name: Test with tox | |
run: tox | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment