-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
4,448 additions
and
2,803 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
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
11 changes: 6 additions & 5 deletions
11
.github/workflows/black.yml → .github/workflows/run-black.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Static Code Tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: [] | ||
|
||
env: | ||
PYTHON_VERSION: '3.10' | ||
POETRY_VERSION: '1.7.1' | ||
|
||
jobs: | ||
tests: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Local action that tries to cache as much of python & poetry as possible | ||
- name: Setup environment | ||
uses: ./.github/workflows/setup-python | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
poetry-version: ${{ env.POETRY_VERSION }} | ||
|
||
- name: Check with pytest | ||
run: poetry run pytest | ||
|
||
types: | ||
name: Run typechecking | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
# Local action that tries to cache as much of python & poetry as possible | ||
- name: Setup environment | ||
uses: ./.github/workflows/setup-python | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
poetry-version: ${{ env.POETRY_VERSION }} | ||
|
||
- name: Check with pyright | ||
run: poetry run pyright uqcsbot |
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,69 @@ | ||
name: Setup Env | ||
description: Setup python & poetry for running tests & typechecking | ||
|
||
inputs: | ||
python-version: | ||
description: Version of python to use | ||
required: true | ||
poetry-version: | ||
description: Version of poetry to use | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
# ------ | ||
# Get python | ||
# ------ | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
# ------ | ||
# Get poetry (hopefully from cache) | ||
# ------ | ||
- name: Check for cached poetry binary | ||
id: cached-poetry-binary | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local | ||
# poetry depends on OS, python version, and poetry version | ||
key: poetry-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.poetry-version }} | ||
|
||
- name: Install poetry on cache miss | ||
# we don't need an `if:` here because poetry checks if it's already installed | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: ${{ inputs.poetry-version }} | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
virtualenvs-path: '**/.venv' | ||
installer-parallel: true | ||
|
||
- name: Ensure poetry is on PATH | ||
run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH | ||
shell: bash | ||
|
||
# ------ | ||
# Get library dependencies (hopefully from cache) | ||
# ------ | ||
- name: Check for cached dependencies | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: '**/.venv' | ||
# poetry dependencies depend on OS, python version, poetry version, and repository lockfile | ||
key: poetry-deps-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.poetry-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies on cache miss | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
shell: bash | ||
|
||
# ------ | ||
# Finalise install | ||
# ------ | ||
- name: Install main project | ||
run: poetry install --no-interaction | ||
shell: bash |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -131,3 +131,7 @@ dmypy.json | |
.vim | ||
*.db | ||
**/.DS_STORE | ||
.vscode/* | ||
|
||
# (per-user) configs for pyright | ||
pyrightconfig.json |
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
Oops, something went wrong.