add transforms #47
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: Test Code | |
on: | |
push: | |
branches: | |
- "**" | |
- "!gh-pages" | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
name: | |
description: 'Test It' | |
required: false | |
default: 'I Just wanna test it' | |
permissions: | |
contents: read | |
issues: read | |
checks: write | |
pull-requests: write | |
jobs: | |
test: | |
strategy: | |
matrix: | |
python-version: [3.9.16, 3.10.8] | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup Poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: 1.3.2 | |
- name: Install | |
run: poetry install | |
- name: Build coverage file | |
run: | | |
poetry run pytest --cache-clear --junitxml=test_results/${{ matrix.os }}/pytest_report_${{ matrix.python-version }}.xml tests/ | |
- name: Check files | |
run: | | |
ls -l test_results/ | |
ls -l test_results/${{ matrix.os }}/ | |
- name: Upload Test Results | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pytest-results-${{ matrix.python-version }} | |
path: test_results/${{ matrix.os }}/pytest_report_${{ matrix.python-version }}.xml | |
# - name: Comment coverage | |
# uses: coroo/[email protected] | |
publish-test-results: | |
name: "Publish Tests Results" | |
needs: test | |
runs-on: ubuntu-latest | |
# the build-and-test job might be skipped, we don't need to run this job then | |
if: success() || failure() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: Check files | |
run: | | |
ls -l artifacts/ | |
- name: Publish test results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
junit_files: "artifacts/**/*.xml" |