-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (42 loc) · 1.32 KB
/
pr-check.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
# This workflow will check pull request and run tests
name: Pull Request Check
on:
pull_request:
branches:
- main
permissions:
checks: write
pull-requests: write
jobs:
build:
name: 🛂 Pull Request Check
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout repository ⚙️
uses: actions/checkout@v4
- name: Setup Python ⚙️
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip' # caching pip dependencies
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies ⚙️
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build and test 🏗️
run: |
pip install httpx pytest pytest-cov coverage
pytest -v --doctest-modules --junitxml=junit/test-results.xml --cov=trading_calendar --cov-report=xml --cov-report=html
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
junit/test-results.xml
- name: Upload coverage reports
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}