-
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (73 loc) · 2.88 KB
/
Copy pathmage_coverage.yml
File metadata and controls
78 lines (73 loc) · 2.88 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
name: MAGE Coverage
on:
push:
branches:
- 'master'
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: mage-coverage-${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow, github.event.pull_request.number) || github.workflow_ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
sonarcloud:
name: Coverage
runs-on: ubuntu-latest
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
python-version: '3.13'
cache: 'pip'
- name: Install dependencies
run: |
cd services/MAGE
python -m pip install --upgrade \
--disable-pip-version-check \
--no-cache-dir \
--only-binary=:all: \
pip==26.1.1 \
uv==0.11.17
python -m uv sync --locked
- name: Coverage Erase
run: |
python -m uv --directory services/MAGE run --locked python -m coverage erase
- name: Coverage Models
run: |
python -m uv --directory services/MAGE run --locked python -m coverage run --parallel-mode -m pytest -q -m "not slow" tests
python -m uv --directory services/MAGE run --locked python -m coverage combine
- name: Coverage Report
run: |
python -m uv --directory services/MAGE run --locked python -m coverage report -m
python -m uv --directory services/MAGE run --locked python -m coverage xml -o ../../coverage.xml
- name: Run codacy-coverage-reporter
if: env.CODACY_PROJECT_TOKEN != ''
uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699
with:
project-token: ${{ env.CODACY_PROJECT_TOKEN }}
coverage-reports: 'coverage.xml'
env:
CODACY_PROJECT_TOKEN: ${{ env.CODACY_PROJECT_TOKEN }}
- name: Skip Codacy coverage when token is not configured
if: env.CODACY_PROJECT_TOKEN == ''
run: echo "CODACY_PROJECT_TOKEN is not configured; skipping Codacy coverage upload."