-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (88 loc) · 2.31 KB
/
Copy pathci-pipeline.yml
File metadata and controls
90 lines (88 loc) · 2.31 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
name: CI pipeline
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ 3.8, 3.9 ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.4
- name: Install dependencies
run: poetry install
- name: Test
run: |
poetry run pytest
poetry run coverage run --branch --source mlaide -m pytest
poetry run coverage xml
- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: coverage.xml
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.1.4
- name: Retrieve version
uses: paulhatch/semantic-version@v4
id: set-version
with:
tag_prefix: v
major_pattern: (MAJOR)
minor_pattern: (MINOR)
format: "${major}.${minor}.${patch}-dev.${increment}"
short_tags: false
- name: Install dependencies
run: poetry install
- name: Set version
run: poetry version ${{ steps.set-version.outputs.version }}
- name: Build Python Wheel
run: poetry build
- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
sonar-scan:
runs-on: ubuntu-latest
needs:
- test
- build
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download coverage result
uses: actions/download-artifact@v2
with:
name: code-coverage-report
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}