Skip to content

Commit 22724e4

Browse files
committed
Fix ci/cd workflow
Use local installation for pre-commit Add Bandit tool for security checks
1 parent 897e7bb commit 22724e4

File tree

14 files changed

+406
-44
lines changed

14 files changed

+406
-44
lines changed

.github/workflows/deploy.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
tests:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-20.04
1414
strategy:
1515
fail-fast: false
1616
matrix:
@@ -32,16 +32,15 @@ jobs:
3232
isort --diff --check-only src
3333
- name: Tests
3434
env:
35-
SQLITE_CONNECTION_STRING: ${{ secrets.SQLITE_CONNECTION_STRING }}
35+
SQLITE_CONNECTION_STRING: ${{ vars.SQLITE_CONNECTION_STRING }}
3636
SQLITE_USER: ${{ secrets.SQLITE_USER }}
3737
SQLITE_PASSWORD: ${{ secrets.SQLITE_PASSWORD }}
3838
SQLITE_API_KEY: ${{ secrets.SQLITE_API_KEY }}
39-
SQLITE_HOST: ${{ secrets.SQLITE_HOST }}
40-
SQLITE_DB: ${{ secrets.SQLITE_DB }}
41-
SQLITE_PORT: ${{ secrets.SQLITE_PORT }}
39+
SQLITE_HOST: ${{ vars.SQLITE_HOST }}
40+
SQLITE_DB: ${{ vars.SQLITE_DB }}
41+
SQLITE_PORT: ${{ vars.SQLITE_PORT }}
4242
run: |
4343
pytest -v src/tests
44-
4544
release:
4645
if: ${{ github.ref == 'refs/heads/main' }}
4746
needs: tests

.pre-commit-config.yaml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#
2+
# Keep these versions requirements.txt versions aligned.
3+
#
14
repos:
25
- repo: https://github.com/pre-commit/pre-commit-hooks
36
rev: v3.2.0
@@ -11,10 +14,10 @@ repos:
1114
rev: 22.8.0
1215
hooks:
1316
- id: black
14-
# It is recommended to specify the latest version of Python
15-
# supported by your project here, or alternatively use
16-
# pre-commit's default_language_version, see
17-
# https://pre-commit.com/#top_level-default_language_version
17+
# It is recommended to specify the latest version of Python
18+
# supported by your project here, or alternatively use
19+
# pre-commit's default_language_version, see
20+
# https://pre-commit.com/#top_level-default_language_version
1821
language_version: python3.6
1922
- repo: https://github.com/pycqa/isort
2023
rev: 5.10.1
@@ -24,9 +27,30 @@ repos:
2427
- repo: https://github.com/PyCQA/autoflake
2528
rev: v1.4
2629
hooks:
27-
- id: autoflake
30+
- id: autoflake
31+
name: autoflake
32+
args:
33+
- "--in-place"
34+
- "--expand-star-imports"
35+
- "--remove-duplicate-keys"
36+
- "--remove-unused-variables"
37+
- "--remove-unused-variables"
2838
- repo: https://github.com/pycqa/flake8
2939
rev: 5.0.4
3040
hooks:
3141
- id: flake8
32-
stages: [push]
42+
name: flake8
43+
# stages: [push]
44+
- repo: https://github.com/PyCQA/bandit
45+
rev: 1.7.1
46+
hooks:
47+
- id: bandit
48+
name: bandit
49+
entry: bandit
50+
args:
51+
- "-b"
52+
- "bandit-baseline.json"
53+
- "--configfile"
54+
- "bandit.yaml"
55+
- "-r"
56+
- "src"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ $ pip install SqliteCloud
1919
```python
2020
from sqlitecloud.client import SqliteCloudClient
2121
from sqlitecloud.types import SqliteCloudAccount
22+
2223
```
2324

2425
### _Init a connection_

0 commit comments

Comments
 (0)