-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.62 KB
/
main.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
name: CI with contracts run through command line
on:
push:
branches: [ main ]
jobs:
build:
strategy:
matrix:
# Temporarily removed windows-latest, replaced with macos-latest
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
path: main
- name: Set up JRE 17
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
java-package: 'jre'
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Run pip install
working-directory: main
run: pip install -r requirements.txt
- name: Run contract as tests with Specmatic Python
working-directory: main
run: coverage run --branch -m pytest test/test_contract_with_api_coverage.py -v -s --junitxml contract-test-reports/TEST-junit-jupiter.xml
- name: Publish contract test report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/contract-test-reports/TEST-*.xml'
- name: Generate coverage report
working-directory: main
run: coverage html -d coverage-report
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: ${{matrix.os}}-coverage-report
path: main/coverage-report
- name: Upload HTML Test Report
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-html-report
path: main/build/reports/specmatic/html