Skip to content

Commit 2cc6613

Browse files
committed
SDK-1853: Add github workflows for tests and sonar
1 parent ae40e85 commit 2cc6613

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/workflows/sonar.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Sonar Scan
2+
on: [push, pull_request_target]
3+
4+
jobs:
5+
sonar:
6+
name: Sonar Scan
7+
runs-on: ubuntu-latest
8+
# always run on push events
9+
# only run on pull_request_target event when pull request pulls from fork repository
10+
if: >
11+
github.event_name == 'push' ||
12+
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: sonarsource/sonarcloud-github-action@master
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
23+

.github/workflows/tests.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Unit Tests
2+
on: [push, pull_request_target]
3+
4+
jobs:
5+
test:
6+
name: Test (Python ${{ matrix.python-version }})
7+
runs-on: ubuntu-latest
8+
# always run on push events
9+
# only run on pull_request_target event when pull request pulls from fork repository
10+
if: >
11+
github.event_name == 'push' ||
12+
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: [2.7, 3.4, 3.5, "3.5-dev", 3.6, "3.6-dev", 3.7, "3.7-dev", 3.8, "3.8-dev"]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: actions/[email protected]
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- run: pip install -U setuptools
26+
27+
- run: pip install -r requirements.txt
28+
29+
- run: pip install -e .[dev]
30+
31+
- run: pytest -v
32+
33+
examples:
34+
name: Check Examples
35+
runs-on: ubuntu-latest
36+
if: >
37+
github.event_name == 'push' ||
38+
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
39+
40+
steps:
41+
- uses: actions/checkout@v2
42+
43+
- uses: actions/[email protected]
44+
45+
- run: pip install -U setuptools==45
46+
47+
- run: pushd examples/aml && pip install -r requirements.txt && popd
48+
49+
- run: pushd examples/yoti_example_django && pip install -r requirements.txt && popd
50+
51+
- run: pushd examples/yoti_example_flask && pip install -r requirements.txt && popd
52+
53+
- run: pushd examples/doc_scan && pip install -r requirements.txt && popd

0 commit comments

Comments
 (0)