Move portal code into its own app code #11
Workflow file for this run
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
name: CI - Linting and Testing | |
on: | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
requirements: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./portal | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install --no-root | |
- name: Validate requirements | |
run: poetry check | |
ruff: | |
needs: requirements | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./portal | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install --no-root --only dev | |
- name: List added, copied, modified, and renamed *py files | |
id: git_diff | |
run: | | |
git fetch origin main | |
git diff --name-only --diff-filter=ACMR origin/main | grep -E "(.py$)" > diff.txt || true | |
- name: Ruff linting | |
run: | | |
poetry run ruff check --config=pyproject.toml . &> lint_checks.txt || true | |
- name: Diff-based ruff | |
run: | | |
grep -Ff diff.txt lint_checks.txt > lint_errors.txt || true | |
if [ -s lint_errors.txt ]; then | |
cat lint_errors.txt | |
echo 'Run the following command to fix your branch: make fixes' | |
exit 1 | |
fi | |
black: | |
needs: requirements | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./portal | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install --no-root --only dev | |
- name: List added, copied, modified, and renamed *py files | |
id: git_diff | |
run: | | |
git fetch origin main | |
git diff --name-only --diff-filter=ACMR origin/main | grep -E "(.py$)" > diff.txt || true | |
- name: Black code formatting | |
run: | | |
poetry run black --check --diff --color --config=pyproject.toml . &> lint_checks.txt || true | |
- name: Diff-based black | |
run: | | |
grep -Ff diff.txt lint_checks.txt > lint_errors.txt || true | |
if [ -s lint_errors.txt ]; then | |
cat lint_errors.txt | |
echo 'Run the following command to fix your branch: make fixes' | |
exit 1 | |
fi |