Python Tests #554
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: Python Tests | |
| on: | |
| schedule: | |
| - cron: 0 */6 * * * | |
| pull_request: {} | |
| jobs: | |
| python_test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| variant: linux | |
| - os: macos-latest | |
| variant: macOS | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run pytest tests | |
| id: pytest_tests | |
| if: ${{ always() }} | |
| run: | |
| pytest python/pytest/** --junitxml=python/results/pytest/pytest_test.xml -o | |
| junit_family=xunit1 | |
| continue-on-error: true | |
| - name: Process pytest results | |
| # Run this step even if the test step ahead fails | |
| if: ${{ always() }} | |
| uses: trunk-io/analytics-uploader@main | |
| env: | |
| TRUNK_PUBLIC_API_ADDRESS: "https://api.trunk-staging.io" | |
| with: | |
| # Path to your test results. | |
| junit-paths: python/results/pytest/pytest_test.xml | |
| # Provide your Trunk organization slug. | |
| org-slug: trunk-staging-org | |
| public-repo-id: NNSvcFXb | |
| # Variant to distinguish between OS platforms | |
| variant: ${{ matrix.variant }} | |
| # Pass the test outcome for quarantining support | |
| previous-step-outcome: ${{ steps.pytest_tests.outcome }} | |
| test-collection-id: kaNuMDag | |
| - name: Run robotframework tests | |
| id: robotframework_tests | |
| if: ${{ always() }} | |
| run: | |
| pabot --testlevelsplit --outputdir=python/results/robotframework --output=output.xml --xunit=robot_test.xml | |
| python/robotframework/** | |
| continue-on-error: true | |
| - name: Process robotframework results | |
| # Run this step even if the test step ahead fails | |
| if: ${{ always() }} | |
| uses: trunk-io/analytics-uploader@main | |
| env: | |
| TRUNK_PUBLIC_API_ADDRESS: "https://api.trunk-staging.io" | |
| with: | |
| # Path to your test results. | |
| junit-paths: python/results/robotframework/robot_test.xml | |
| # Provide your Trunk organization slug. | |
| org-slug: trunk-staging-org | |
| public-repo-id: NNSvcFXb | |
| # Variant to distinguish between OS platforms | |
| variant: ${{ matrix.variant }} | |
| # Pass the test outcome for quarantining support | |
| previous-step-outcome: ${{ steps.robotframework_tests.outcome }} | |
| test-collection-id: kaNuMDag | |
| - name: Upload JUnit XML artifacts | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-junit-results-${{ matrix.variant }} | |
| path: | | |
| python/results/**/*_test.xml | |
| python/**/*_test.xml | |
| retention-days: 7 |