-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (42 loc) · 1.21 KB
/
main.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
name: main
on:
push:
branches-ignore:
- 'release/**'
- 'master'
jobs:
build:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[skip ci]')"
env:
CI: false
strategy:
max-parallel: 4
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: psf/black@stable
if: matrix.python-version == 3.7 && matrix.os == 'ubuntu-latest'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.test.txt
- name: Test with unittest
run: |
coverage run --source=./hadar -m unittest discover tests
coverage xml -i
- name: SonarCloud Scan
if: matrix.python-version == 3.7 && matrix.os == 'ubuntu-latest'
uses: sonarsource/sonarcloud-github-action@master
with:
name: coverage-report
path: coverage.xml
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}