Skip to content

Commit f7ef849

Browse files
committed
Added GitHub actions
1 parent 15af143 commit f7ef849

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

.github/workflows/build.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: [3.9]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r requirements.txt
27+
pip install -r test-requirements.txt
28+
- name: Lint with flake8
29+
run: |
30+
# stop the build if there are Python syntax errors or undefined names
31+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34+
- name: Install locally
35+
run: |
36+
python ./setup.py install
37+
- name: Test with pytest
38+
run: |
39+
python -m pytest --junitxml=build/test-results-${{ matrix.python-version }}.xml
40+
- name: Upload pytest test results
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: pytest-results-${{ matrix.python-version }}
44+
path: build/test-results-${{ matrix.python-version }}.xml
45+
# Use always() to always run this step to publish test results when there are test failures
46+
if: ${{ always() }}
47+
- name: Upload coverage
48+
uses: actions/upload-artifact@v2
49+
with:
50+
name: coverage
51+
path: build/coverage.xml

.github/workflows/sast.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "SAST"
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
schedule:
7+
- cron: '22 1 * * 6'
8+
9+
jobs:
10+
analyze:
11+
name: Analyze
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
language: [ 'python' ]
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
22+
- name: Initialize CodeQL
23+
uses: github/codeql-action/init@v1
24+
with:
25+
languages: ${{ matrix.language }}
26+
27+
- name: Perform CodeQL Analysis
28+
uses: github/codeql-action/analyze@v1

0 commit comments

Comments
 (0)