-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.44 KB
/
unit_tests.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
name: "Unit tests for DSO"
on:
push:
branches:
- main
paths-ignore:
- "docs/**"
- "*.md"
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
jobs:
unit_tests_linux:
name: "Python ${{ matrix.python-version }}"
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.12"]
env:
# GitHub currently has 4 cores available for Linux runners
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
worker_cores: 4
steps:
- uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Install libgit2 header files for libgit2 & pandoc for testing purposes
run: sudo apt-get install -y libgit2-dev pandoc
- name: "Install DSO"
run: pip install -e '.[test]'
- name: "Run unit tests"
run: pytest -vv tests -n ${{ env.worker_cores }} --cov=dso --cov-report=xml
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}