PAF tests #3
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: PAF tests | |
on: | |
workflow_run: | |
workflows: [ 'Build PAF test base image' ] | |
types: [ completed ] | |
push: | |
branches: [ "main" ] | |
paths: | |
- .github/workflows/tests.yml | |
- paf/** | |
- test/** | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- .github/workflows/tests.yml | |
- paf/** | |
- test/** | |
permissions: | |
contents: read | |
checks: write | |
pull-requests: write | |
jobs: | |
run-tests: | |
name: "Run integration tests" | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/mreiche/paf-test-base:main | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.DOCKER_CONTAINER_REGISTRY_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Test with pytest | |
env: | |
PAF_TEST_HEADLESS: 1 | |
PAF_TEST_CONTAINER: 1 | |
PAF_TEST_LOCAL_SELENIUM: 0 | |
PAF_BROWSER_SETTING: chrome | |
SE_OFFLINE: true | |
PAF_DRIVER_PATH: "/usr/local/bin/chromedriver" | |
PAF_BINARY_PATH: "/usr/local/bin/chrome" | |
run: | | |
java -jar /home/selenium-server.jar standalone --host 127.0.0.1 & | |
pytest --cov=paf -n=4 --junitxml=test-results/tests.xml test | |
- name: Generate coverage report | |
run: coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
continue-on-error: true | |
with: | |
fail_ci_if_error: true | |
files: ./coverage.xml | |
verbose: true | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: | | |
test-results/**/*.xml |