-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (61 loc) · 2.72 KB
/
build_and_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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