-
Notifications
You must be signed in to change notification settings - Fork 22
47 lines (39 loc) · 1.51 KB
/
ci.yaml
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
name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
environment: 'Test CI'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
run: |
poetry install
poetry install -E 'podcast xinference'
- name: Run tests and generate coverage report
run: poetry run coverage run -m pytest test --ignore=./volumes
shell: bash
- name: Generate coverage badge
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.event.action == 'closed' && github.base_ref == 'refs/heads/main' && github.event.pull_request.merged == true)
run: poetry run coverage-badge -f -o docs/coverage/coverage.svg
shell: bash
- name: Commit changes
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && github.event.action == 'closed' && github.base_ref == 'refs/heads/main' && github.event.pull_request.merged == true)
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: coverage
FOLDER: docs/coverage
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}