Skip to content

Commit e0c3ae0

Browse files
committed
add workflows
1 parent 86db55a commit e0c3ae0

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed

.github/FUNDING.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These are supported funding model platforms
2+
3+
github: [areed1192]
4+
patreon: sigmacoding
5+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/codeql-analysis.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [master]
9+
schedule:
10+
- cron: "0 16 * * 4"
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
# Override automatic language detection by changing the below list
21+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
22+
language: ["python"]
23+
# Learn more...
24+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v2
29+
with:
30+
# We must fetch at least the immediate parents so that if this is
31+
# a pull request then we can checkout the head.
32+
fetch-depth: 2
33+
34+
# If this run was triggered by a pull request event, then checkout
35+
# the head of the pull request instead of the merge commit.
36+
- run: git checkout HEAD^2
37+
if: ${{ github.event_name == 'pull_request' }}
38+
39+
# Initializes the CodeQL tools for scanning.
40+
- name: Initialize CodeQL
41+
uses: github/codeql-action/init@v1
42+
with:
43+
languages: ${{ matrix.language }}
44+
45+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
46+
# If this step fails, then you should remove it and run the build manually (see below)
47+
- name: Autobuild
48+
uses: github/codeql-action/autobuild@v1
49+
50+
# ℹ️ Command-line programs to run using the OS shell.
51+
# 📚 https://git.io/JvXDl
52+
53+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
54+
# and modify them (or add more) to build your code if your project
55+
# uses a compiled language
56+
57+
#- run: |
58+
# make bootstrap
59+
# make release
60+
61+
- name: Perform CodeQL Analysis
62+
uses: github/codeql-action/analyze@v1

.github/workflows/python-package.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [master]
9+
pull_request:
10+
branches: [master]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: [3.5, 3.6, 3.7, 3.8]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install Dependencies from Requirements File.
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8 pytest
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
32+
- name: Lint with flake8.
33+
run: |
34+
# stop the build if there are Python syntax errors or undefined names
35+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36+
37+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39+
40+
- name: Test with Unittest.
41+
run: |
42+
if [ -f tests/test_client.py ]; python -m unittest tests/test_client.py; fi

0 commit comments

Comments
 (0)