Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"extends": [
"plugin:vue/essential",
// "plugin:vue/recommended" // TODO
"@vue/standard"
// "@vue/standard"
],
"rules": {
"comma-dangle": [
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Code Quality
on: pull_request

jobs:
# Linting job, uses the existing pre-commit as the standard for tools
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # Latest stable version
- name: Python setup
uses: actions/setup-python@v4
with:
python-version-file: '.python-version'
- name: Cache pipenv dependencies
uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} # Cache key based on hash of Pipfile.lock for CI speed
restore-keys: |
${{ runner.os }}-pipenv-
- name: Node setup
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm' # Cache npm dependencies
- name: Install dependencies
run: |
pip install pre-commit
npm ci
- name: Run pre-commit
run: |
pre-commit install --install-hooks
pre-commit run --all-files
33 changes: 29 additions & 4 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,41 @@ jobs:
python -m pip install pipenv
pipenv install --system --dev --deploy
npm ci
- name: Run linting
run: npm run lint
# - name: Run linting
# run: npm run lint
- name: Run build and collect
run: |
npm run build
python ./tabbycat/manage.py collectstatic --noinput -v 0
- name: Run migrations
run: python ./tabbycat/manage.py migrate
- name: Run tests
run: python tabbycat/manage.py test -v 2 --exclude-tag=selenium
- name: Run tests and generate coverage reports
run: |
pip install coverage # Install in CI only, not needed as Pipenv dependency
coverage run --source='tabbycat' tabbycat/manage.py test -v 2 --exclude-tag=selenium
coverage xml
coverage report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: success()
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Install Reviewdog
run: |
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
echo "$(pwd)/bin" >> $GITHUB_PATH

- name: Run pre-commit with Reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pre-commit run --all-files --show-diff-on-failure \
| ./bin/reviewdog -f=diff \
-name="pre-commit" \
-reporter=github-pr-review \
-fail-on-error=false

build-docker-dev:

Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Reviewdog Linting

on:
push:
branches:
- develop
- master
pull_request:
branches:
- '**'
- '!l10n_develop'

jobs:
reviewdog-lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Python setup
uses: actions/setup-python@v4
with:
python-version-file: '.python-version'

- name: Cache pipenv dependencies
uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-

- name: Node setup
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv install --system --dev --deploy
npm ci

- name: Run ESLint with ReviewDog
uses: reviewdog/action-eslint@v1.33.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
level: warning

- name: Run Flake8 with ReviewDog
uses: reviewdog/action-flake8@v3.15.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
level: warning
Loading
Loading