-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use bind_params to avoid SQL injection
- Loading branch information
Showing
21 changed files
with
317 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
|
||
# Maintain dependencies for client | ||
- package-ecosystem: "npm" | ||
directory: "/client" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 10 | ||
|
||
# Maintain dependencies for server | ||
- package-ecosystem: "pip" | ||
directory: "/server" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ main ] | ||
schedule: | ||
- cron: '41 3 * * 0' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'javascript', 'python' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v3 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
--- | ||
|
||
name: CI | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events | ||
push: | ||
pull_request: | ||
release: | ||
tags: | ||
- 'v*' | ||
types: [published] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Server_tests: | ||
name: Server tests | ||
|
||
runs-on: ubuntu-latest | ||
|
||
# Test different python versions | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.9'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check out repo | ||
uses: actions/checkout@v2 | ||
- name: Setup InfluxDB | ||
uses: influxdata/influxdb-action@v3 | ||
with: | ||
influxdb_version: 1.11.5 | ||
influxdb_org: influxdata | ||
influxdb_user: "" | ||
influxdb_password: "" | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
cache-dependency-path: 'requirements/*.txt' | ||
|
||
- name: Display Python version | ||
run: | | ||
python -c "import sys; print(sys.version)" | ||
echo coverage: .${{ matrix.coverage }}. | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install pip setuptools wheel | ||
pip install --upgrade pip | ||
pip install -r ./requirements/test.txt | ||
pip install flake8 | ||
- name: Run flake8 | ||
run: | | ||
cd ./server | ||
flake8 . | ||
- name: Run tests with coverage | ||
run: | | ||
cd ./server | ||
coverage run -m pytest test --cov-report xml --cov=server | ||
timeout-minutes: 20 | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
if: success() | ||
|
||
|
||
Client_build: | ||
name: Client build | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Run errands | ||
run: | | ||
sudo apt -y install curl | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "DIR=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/cache@v4 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.DIR }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Use Node.js 20 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.11.1" | ||
cache: "yarn" | ||
cache-dependency-path: '**/yarn.lock' | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
source ~/.nvm/nvm.sh | ||
rm -rf ~/.yarn | ||
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.19 | ||
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" | ||
yarn -v | ||
# nvm install "16.10.0" | ||
# nvm use "16.10.0" | ||
env: | ||
VNM_DIR: ~/.nvm | ||
|
||
- name: Run tests | ||
shell: bash | ||
run: | | ||
cd client | ||
yarn install | ||
CI=true yarn test | ||
yarn build | ||
env: | ||
CI: true | ||
VNM_DIR: ~/.nvm | ||
INLINE_RUNTIME_CHUNK: False | ||
IMAGE_INLINE_SIZE_LIMIT: 0 | ||
timeout-minutes: 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.