Skip to content

Commit

Permalink
Fix ci/cd workflow
Browse files Browse the repository at this point in the history
Use local installation for pre-commit
Add Bandit tool for security checks
  • Loading branch information
danielebriggi committed May 24, 2024
1 parent 897e7bb commit 22724e4
Show file tree
Hide file tree
Showing 14 changed files with 406 additions and 44 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
tests:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
Expand All @@ -32,16 +32,15 @@ jobs:
isort --diff --check-only src
- name: Tests
env:
SQLITE_CONNECTION_STRING: ${{ secrets.SQLITE_CONNECTION_STRING }}
SQLITE_CONNECTION_STRING: ${{ vars.SQLITE_CONNECTION_STRING }}
SQLITE_USER: ${{ secrets.SQLITE_USER }}
SQLITE_PASSWORD: ${{ secrets.SQLITE_PASSWORD }}
SQLITE_API_KEY: ${{ secrets.SQLITE_API_KEY }}
SQLITE_HOST: ${{ secrets.SQLITE_HOST }}
SQLITE_DB: ${{ secrets.SQLITE_DB }}
SQLITE_PORT: ${{ secrets.SQLITE_PORT }}
SQLITE_HOST: ${{ vars.SQLITE_HOST }}
SQLITE_DB: ${{ vars.SQLITE_DB }}
SQLITE_PORT: ${{ vars.SQLITE_PORT }}
run: |
pytest -v src/tests
release:
if: ${{ github.ref == 'refs/heads/main' }}
needs: tests
Expand Down
36 changes: 30 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#
# Keep these versions requirements.txt versions aligned.
#
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
Expand All @@ -11,10 +14,10 @@ repos:
rev: 22.8.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.6
- repo: https://github.com/pycqa/isort
rev: 5.10.1
Expand All @@ -24,9 +27,30 @@ repos:
- repo: https://github.com/PyCQA/autoflake
rev: v1.4
hooks:
- id: autoflake
- id: autoflake
name: autoflake
args:
- "--in-place"
- "--expand-star-imports"
- "--remove-duplicate-keys"
- "--remove-unused-variables"
- "--remove-unused-variables"
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
stages: [push]
name: flake8
# stages: [push]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.1
hooks:
- id: bandit
name: bandit
entry: bandit
args:
- "-b"
- "bandit-baseline.json"
- "--configfile"
- "bandit.yaml"
- "-r"
- "src"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ $ pip install SqliteCloud
```python
from sqlitecloud.client import SqliteCloudClient
from sqlitecloud.types import SqliteCloudAccount

```

### _Init a connection_
Expand Down
Loading

0 comments on commit 22724e4

Please sign in to comment.