fix(test): robustness (#64)

This commit is contained in:
Aaron Pham
2023-06-24 11:10:07 -04:00
committed by GitHub
parent 98328be394
commit 3593c764f0
21 changed files with 644 additions and 97 deletions

View File

@@ -23,6 +23,7 @@ env:
LINES: 120
COLUMNS: 120
OPENLLM_DO_NOT_TRACK: True
PYTHONUNBUFFERED: '1'
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
defaults:
run:
@@ -43,7 +44,60 @@ jobs:
- name: Setup CI
uses: ./.github/actions/setup-repo
- name: Run tests
run: hatch run test:p
run: hatch run test:full
- name: Disambiguate coverage filename
run: mv .coverage ".coverage.${{ matrix.os }}"
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: .coverage.*
coverage:
name: Coverage
runs-on: ubuntu-latest
needs:
- tests
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup CI
uses: ./.github/actions/setup-repo
- name: Download coverage data
uses: actions/download-artifact@v3
with:
name: coverage-data
- name: Combine coverage data
run: hatch run coverage:combine
- name: Export coverage reports
run: |
hatch run coverage:report-xml
hatch run coverage:report-uncovered-html
- name: Upload uncovered HTML report
uses: actions/upload-artifact@v3
with:
name: uncovered-html-report
path: htmlcov
- name: Generate coverage summary
run: hatch run coverage:generate-summary
- name: Write coverage summary report
if: github.event_name == 'pull_request'
run: hatch run coverage:write-summary-report
- name: Update coverage pull request comment
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork
uses: marocchino/sticky-pull-request-comment@v2
with:
path: coverage-report.md
check: # https://github.com/marketplace/actions/alls-green#why
if: always()
needs:
- coverage
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
concurrency:
group: ci-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true