define next_url to avoid error when a request fails #210
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: Build and Test | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build_and_test: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
# - name: Docker Compose Setup | |
# run: | | |
# sudo apt-get install docker-compose-plugin | |
# docker compose version | |
- name: pre-commit | |
run: make run-pre-commit | |
# setup and install everything and run tests | |
- name: up | |
run: make up | |
- name: Create reports output folder | |
run: mkdir -p /home/runner/work/${{ github.repository }}/reports | |
- name: tests | |
run: | | |
docker compose run --rm --name helix.fhir.client.sdk -v /home/runner/work/${{ github.repository }}/reports:/reports dev pytest tests --tb=auto --junitxml=/reports/test-results.xml | |
docker compose run --rm --name helix.fhir.client.sdk -v /home/runner/work/${{ github.repository }}/reports:/reports dev pytest tests_integration --tb=auto --junitxml=/reports/test-results-integration.xml | |
- name: Upload pytest test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pytest-results | |
path: /home/runner/work/${{ github.repository }}/reports/**/*.xml | |
# Use always() to always run this step to publish test results when there are test failures | |
if: ${{ always() }} | |
- name: Verify reports are generated | |
if: ${{ always() }} | |
run: ls -halt /home/runner/work/${{ github.repository }}/reports/ | |
# Publish all test results in the GitHub UI | |
- name: Surface failing tests | |
if: always() | |
uses: pmeier/pytest-results-action@fc6576eced1f411ea48ab10e917d9cfce2960e29 # https://github.com/pmeier/pytest-results-action | |
with: | |
# A list of JUnit XML files, directories containing the former, and wildcard | |
# patterns to process. | |
# See @actions/glob for supported patterns. | |
path: /home/runner/work/${{ github.repository }}/reports/*.xml | |
# (Optional) Add a summary of the results at the top of the report | |
summary: true | |
# (Optional) Select which results should be included in the report. | |
# Follows the same syntax as `pytest -r` | |
display-options: fEX | |
# (Optional) Fail the workflow if no JUnit XML was found. | |
fail-on-empty: true | |
# (Optional) Title of the test results section in the workflow summary | |
title: Test results |