Skip to content

Commit

Permalink
Revert to template CI for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuchenb committed May 2, 2024
1 parent 1110a33 commit 54636ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
34 changes: 8 additions & 26 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,34 @@
name: Tests
name: Run test suite and measure coverage

on: push

jobs:
tests:
name: Tests
name: Run test suite

runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v4

- name: Common steps
id: common
uses: ghga-de/gh-action-common@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install tox plugin
id: install-tox-gh-actions
run: |
pip install --disable-pip-version-check "tox-gh-actions>=3.2,<4"
uses: ghga-de/gh-action-common@v6

- name: Run tests with Python ${{ matrix.python-version }}
- name: Run tests
id: pytest
if: ${{ matrix.python-version != '3.12' }}
run: |
export ${{ steps.common.outputs.CONFIG_YAML_ENV_VAR_NAME }}="${{ steps.common.outputs.CONFIG_YAML }}"
tox
- name: Run tests with Python ${{ matrix.python-version }} measuring coverage
id: pytest-coverage
if: ${{ matrix.python-version == '3.12' }}
run: |
export ${{ steps.common.outputs.CONFIG_YAML_ENV_VAR_NAME }}="${{ steps.common.outputs.CONFIG_YAML }}"
tox -- --cov="${{ steps.common.outputs.PACKAGE_NAME }}" --cov-report=xml
pytest \
--cov="${{ steps.common.outputs.PACKAGE_NAME }}" \
--cov-report=xml \
tests
- name: Upload coverage to coveralls
id: coveralls
if: ${{ matrix.python-version == '3.12' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
1 change: 0 additions & 1 deletion .template/static_files_ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
.github/workflows/check_openapi_spec.yaml
.github/workflows/check_readme.yaml
.github/workflows/cd.yaml
.github/workflows/tests.yaml
.github/workflows/ci_release.yaml
.github/workflows/ci_workflow_dispatch.yaml

Expand Down

0 comments on commit 54636ac

Please sign in to comment.