-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (40 loc) · 1.45 KB
/
test-and-coverage.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
# Syntax reference for this file:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: test-and-coverage
on: [push]
# https://gist.github.com/c-bata/ed5e7b7f8015502ee5092a3e77937c99
jobs:
test-and-cover:
name: Test
runs-on: ubuntu-latest
steps:
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v2
# https://github.com/marketplace/actions/setup-python
# ^-- This gives info on matrix testing.
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: "3.10"
# I don't know where the "run" thing is documented.
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install coverage coverage-badge
pip install .
- name: Run unittest and Generate Coverage Badge
if: success()
run: |
mkdir output
coverage run --source=./bitbucketserver -m unittest discover .
coverage-badge -o output/coverage.svg
# https://github.com/peaceiris/actions-gh-pages
- name: Deploy
if: success()
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: coverage-badge
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: output/
# This action probably does everything for you:
# https://github.com/marketplace/actions/sphinx-build