Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Tests

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
test:
runs-on: ubuntu-latest

permissions:
checks: write
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-

- name: Install dependencies
run: poetry install --without compass

- name: Run tests
run: poetry run pytest --junitxml=report.xml --cov=pleque --cov-report=xml:coverage.xml --cov-report=term-missing

- name: Upload test results artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
report.xml
coverage.xml

- name: Publish test results
uses: dorny/test-reporter@v1
if: always()
with:
name: pytest results
path: report.xml
reporter: java-junit

- name: Publish coverage summary
uses: irongut/CodeCoverageSummary@v1.3.0
if: always()
with:
filename: coverage.xml
badge: true
format: markdown
output: both

- name: Add coverage comment to PR
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
12 changes: 12 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ before_script:

test:pytest:
script:
- pytest --junitxml=report.xml --cov=pleque --cov-report=xml:coverage.xml --cov-report=term-missing
artifacts:
when: always
reports:
junit: report.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
paths:
- report.xml
- coverage.xml
expire_in: 1 week
- pytest

lint:ruff:
Expand Down
Loading
Loading