Skip to content

Commit

Permalink
Bump dependencies and speedup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Dec 8, 2022
1 parent 0cba743 commit 639e892
Show file tree
Hide file tree
Showing 25 changed files with 291 additions and 254 deletions.
69 changes: 66 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,69 @@
# Reconsider Dependabot if they ever add grouped updates: https://github.com/dependabot/dependabot-core/issues/1190

# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/**"
allow:
- dependency-type: "production"
directory: "/tournament-scheduler"
target-branch: "develop"
schedule:
interval: "weekly"
labels:
- "dependencies"
- "tournament-scheduler"
assignees:
- "Avasam"
reviewers:
- "Avasam"
ignore:
- dependency-name: "*"
# Temporarily adding version-update:semver-minor to the ignore as dependabot
# still wants to increase the minor version in the lockfile only despite
# versioning-strategy: increase-if-necessary. This is a know issue:
# https://github.com/dependabot/dependabot-core/issues/3891
update-types:
["version-update:semver-patch", "version-update:semver-minor"]
versioning-strategy: increase-if-necessary

- package-ecosystem: "npm"
directory: "/global-scoreboard"
target-branch: "develop"
schedule:
interval: "weekly"
labels:
- "dependencies"
assignees:
- "Avasam"
reviewers:
- "Avasam"
ignore:
- dependency-name: "*"
# Temporarily adding version-update:semver-minor to the ignore as dependabot
# still wants to increase the minor version in the lockfile only despite
# versioning-strategy: increase-if-necessary. This is a know issue:
# https://github.com/dependabot/dependabot-core/issues/3891
update-types:
["version-update:semver-patch", "version-update:semver-minor"]
versioning-strategy: increase-if-necessary

- package-ecosystem: "pip"
directory: "/scripts"
target-branch: "develop"
schedule:
interval: "weekly"
labels:
- "dependencies"
assignees:
- "Avasam"
reviewers:
- "Avasam"

# Check for updates to GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
57 changes: 0 additions & 57 deletions .github/disabled-dependabot.yml

This file was deleted.

58 changes: 29 additions & 29 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ main, develop ]
branches: [main, develop]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
branches: [develop]
schedule:
- cron: '26 13 * * 6'
- cron: "26 13 * * 6"

jobs:
analyze:
Expand All @@ -28,40 +28,40 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'python' ]
language: ["javascript", "python"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
7 changes: 5 additions & 2 deletions .github/workflows/lint-and-build-global-scoreboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ on:
push:
branches:
- main
- develop
paths:
- 'global-scoreboard/**'
- "global-scoreboard/**"
- ".github/workflows/lint-and-build-global-scoreboard.yml"
pull_request:
branches:
- main
- develop
paths:
- 'global-scoreboard/**'
- "global-scoreboard/**"
- ".github/workflows/lint-and-build-global-scoreboard.yml"
jobs:
ESLint:
runs-on: ubuntu-latest
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint-and-build-tournament-scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ on:
push:
branches:
- main
- develop
paths:
- 'tournament-scheduler/**'
- "tournament-scheduler/**"
- ".github/workflows/lint-and-build-tournament-scheduler.yml"
pull_request:
branches:
- main
- develop
paths:
- 'tournament-scheduler/**'
- "tournament-scheduler/**"
- ".github/workflows/lint-and-build-tournament-scheduler.yml"
jobs:
ESLint:
runs-on: ubuntu-latest
Expand Down
65 changes: 31 additions & 34 deletions .github/workflows/lint-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,32 @@ on:
push:
branches:
- main
- develop
paths:
- "**.py"
- "**.pyi"
- ".github/workflows/lint-python.yml"
- "scripts/requirements*.txt"
pull_request:
branches:
- main
- develop
paths:
- "**.py"
- "**.pyi"
- ".github/workflows/lint-python.yml"
- "scripts/requirements*.txt"

env:
# https://help.pythonanywhere.com/pages/ChangingSystemImage/#available-python-versions-for-system-images
python-version: "3.10"
# https://help.pythonanywhere.com/pages/ChangingSystemImage/#base-ubuntu-version-for-each-system-image
# runs-on: "ubuntu-20.04"

jobs:
# Jobs that don't need dependencies installed
isort:
runs-on: ubuntu-latest
runs-on: "ubuntu-20.04"
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
Expand All @@ -29,15 +38,11 @@ jobs:
with:
python-version: ${{ env.python-version }}
cache: "pip"
cache-dependency-path: "scripts/requirements*.txt"
- name: Install dependencies
run: |
pip install wheel
pip install -r "scripts/requirements.txt"
- name: Analysing the code with ${{ job.name }}
run: isort backend/ typings/ --check-only
cache-dependency-path: "scripts/requirements-dev.txt"
- run: pip install isort
- run: isort backend/ typings/ --check-only
add-trailing-comma:
runs-on: ubuntu-latest
runs-on: "ubuntu-20.04"
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
Expand All @@ -46,12 +51,11 @@ jobs:
with:
python-version: ${{ env.python-version }}
cache: "pip"
cache-dependency-path: "scripts/requirements*.txt"
cache-dependency-path: "scripts/requirements-dev.txt"
- run: pip install add-trailing-comma
- name: Analysing the code with ${{ job.name }}
run: add-trailing-comma $(git ls-files '**.py*') --py36-plus
- run: add-trailing-comma $(git ls-files '**.py*') --py36-plus
Bandit:
runs-on: ubuntu-latest
runs-on: "ubuntu-20.04"
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
Expand All @@ -60,13 +64,13 @@ jobs:
with:
python-version: ${{ env.python-version }}
cache: "pip"
cache-dependency-path: "scripts/requirements*.txt"
cache-dependency-path: "scripts/requirements-dev.txt"
- run: pip install bandit
- run: mv backend/configs.template.py backend/configs.py
- name: Analysing the code with ${{ job.name }}
run: bandit -n 1 --severity-level medium --recursive backend
- run: bandit -n 1 --severity-level medium --recursive backend

# Jobs that do need dependencies installed
Pyright:
runs-on: ubuntu-latest
runs-on: "ubuntu-20.04"
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
Expand All @@ -79,15 +83,14 @@ jobs:
- name: Install dependencies
run: |
pip install wheel
pip install -r "scripts/requirements.txt"
pip install -r "scripts/requirements-dev.txt"
- run: mv backend/configs.template.py backend/configs.py
- name: Analysing the code with ${{ job.name }}
uses: jakebailey/pyright-action@v1
- uses: jakebailey/pyright-action@v1
with:
working-directory: backend/
extra-args: --warnings
Pylint:
runs-on: ubuntu-latest
runs-on: "ubuntu-20.04"
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
Expand All @@ -100,12 +103,11 @@ jobs:
- name: Install dependencies
run: |
pip install wheel
pip install -r "scripts/requirements.txt"
pip install -r "scripts/requirements-dev.txt"
- run: mv backend/configs.template.py backend/configs.py
- name: Analysing the code with ${{ job.name }}
run: pylint backend/ --reports=y --output-format=colorized
- run: pylint backend/ --reports=y --output-format=colorized
Flake8:
runs-on: ubuntu-latest
runs-on: "ubuntu-20.04"
steps:
- name: Checkout ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
Expand All @@ -114,11 +116,6 @@ jobs:
with:
python-version: ${{ env.python-version }}
cache: "pip"
cache-dependency-path: "scripts/requirements*.txt"
- name: Install dependencies
run: |
pip install wheel
pip install -r "scripts/requirements.txt"
- run: mv backend/configs.template.py backend/configs.py
- name: Analysing the code with ${{ job.name }}
run: flake8 backend/ typings/
cache-dependency-path: "scripts/requirements-dev.txt"
- run: pip install -r "scripts/requirements-dev.txt"
- run: flake8 backend/ typings/
Loading

0 comments on commit 639e892

Please sign in to comment.