-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 1.79 KB
/
Copy pathpython-run-pytest.yml
File metadata and controls
71 lines (59 loc) · 1.79 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Pytest
on:
pull_request:
paths:
- "src/mountainash_data/**"
workflow_dispatch:
inputs:
fallback_branch:
description: "Fallback branch to use"
required: true
default: "develop"
type: choice
options:
- develop
- main
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
python-version: ["3.12"]
steps:
- name: Set fallback branch
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "FALLBACK_BRANCH=${{ github.event.inputs.fallback_branch }}" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" = "pull_request" ]; then
echo "FALLBACK_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
else
echo "FALLBACK_BRANCH=develop" >> $GITHUB_ENV
fi
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Display SQLite version
run: |
python -c "import sqlite3; print(f'SQLite version: {sqlite3.sqlite_version}')"
- name: Install Hatch
run: pip install hatch
- name: Create virtual environment
run: hatch env create test_github
- name: Run Coverage Tests
run: hatch run test_github:test-cov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
verbose: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1