-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (49 loc) · 1.46 KB
/
ci.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
54
55
56
57
58
name: CI
on:
push:
branches:
- main
tags:
- "**"
pull_request:
env:
PYTEST_ADDOPTS: --color=yes
GITHUB_PR_NUMBER: ${{ github.event.number }}
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Python setup
uses: actions/setup-python@v5
with:
python-version: "3.12"
check-latest: true
- name: Install dependencies
run: |
pip install -e ".[tests]"
- name: Tests
run: pytest --cov --cov-report=xml
- name: Store info for sonar
env:
REF_NAME: ${{ github.ref_name }}
REF_TYPE: ${{ github.ref_type }}
PR_NUMBER: ${{ github.event.pull_request.number }}
SOURCE_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
SOURCE_BRANCH: ${{ github.event.pull_request.head.ref }}
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
run: |
echo "PR_NUMBER=${PR_NUMBER}" >> sonar_env
echo "SOURCE_REPOSITORY=${SOURCE_REPOSITORY}" >> sonar_env
echo "SOURCE_BRANCH=${SOURCE_BRANCH}" >> sonar_env
echo "TARGET_BRANCH=${TARGET_BRANCH}" >> sonar_env
cat sonar_env
# upload coverage report for sonar workflow
- uses: actions/upload-artifact@v4
with:
name: ctapipe-coverage-report
path: |
coverage.xml
sonar_env