-
Notifications
You must be signed in to change notification settings - Fork 6
108 lines (96 loc) · 3.14 KB
/
_codecov.yaml
File metadata and controls
108 lines (96 loc) · 3.14 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# -*- mode: yaml; coding: utf-8 -*-
#
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# All rights reserved.
# https://github.com/btschwertfeger
#
# Template workflow to build the project for a specific os and Python version,
# run the tests and upload the results to codecov.
#
name: CodeCov
on:
workflow_call:
inputs:
os:
type: string
required: true
python-version:
type: string
required: true
secrets:
CODECOV_TOKEN:
required: true
INFINITY_GRID_API_PUBLIC_KEY:
required: true
INFINITY_GRID_API_SECRET_KEY:
required: true
permissions:
contents: read
jobs:
CodeCov:
name: Coverage
runs-on: ${{ inputs.os }}
timeout-minutes: 10
env:
OS: ${{ inputs.os }}
PYTHON: ${{ inputs.python-version }}
environment:
name: codecov
url: https://app.codecov.io/github/btschwertfeger/infinity-grid/
steps:
- name: Harden Runner
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
with:
disable-sudo: true
egress-policy: audit
allowed-endpoints: >
api.codecov.io:443
api.kraken.com:443
api.github.com:443
cli.codecov.io:443
files.pythonhosted.org:443
github.com:443
objects.githubusercontent.com:443
pypi.org:443
storage.googleapis.com:443
ws-auth.kraken.com:443
ws.kraken.com:443
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.0.0
with:
python-version: ${{ inputs.python-version }}
- name: Download the built wheel
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: python-package-distributions
path: dist/
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install package
run: |
uv venv
source .venv/bin/activate
echo ${GITHUB_WORKSPACE}/.venv/bin >> $GITHUB_PATH
uv pip install "$(find dist -name '*.whl' | head -1)" -r requirements-dev.txt
- name: Generate coverage report
env:
INFINITY_GRID_API_PUBLIC_KEY: ${{ secrets.INFINITY_GRID_API_PUBLIC_KEY }}
INFINITY_GRID_API_SECRET_KEY: ${{ secrets.INFINITY_GRID_API_SECRET_KEY }}
run: pytest -vv -x -n auto --cov=infinity_grid --cov-report=xml:coverage.xml tests
- name: Export coverage report
uses: actions/upload-artifact@v6.0.0
with:
name: coverage
path: coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
env_vars: OS,PYTHON
fail_ci_if_error: true
flags: unittests
name: codecov-umbrella
verbose: true