diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 7026d8c4ad..8fab15f250 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -1,6 +1,6 @@ name: CI/CD -on: +on: push: branches: [master] pull_request: @@ -26,69 +26,80 @@ jobs: - 5432:5432 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Set up Python - uses: ./.github/actions/setup-python + - name: Set up Python + uses: ./.github/actions/setup-python - - name: Set up Node - uses: ./.github/actions/setup-node + - name: Set up Node + uses: ./.github/actions/setup-node - - name: Collect static assets - run: | - npm run build - python manage.py collectstatic --noinput + - name: Collect static assets + run: | + npm run build + python manage.py collectstatic --noinput - - name: Check for missing migrations - env: - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres - DJANGO_SETTINGS_MODULE: settings.test - run: | - python manage.py makemigrations --dry-run --check + - name: Check for missing migrations + env: + DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres + DJANGO_SETTINGS_MODULE: settings.test + run: | + python manage.py makemigrations --dry-run --check - - name: Run tests - env: - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres - DJANGO_SETTINGS_MODULE: settings.test - run: | - make test + - name: Run tests + env: + DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres + DJANGO_SETTINGS_MODULE: settings.test + run: | + make test - - name: Report code coverage - uses: codecov/codecov-action@v1 + - name: Report code coverage + uses: codecov/codecov-action@v1 lint: name: "Lint and static checks" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Set up Python - uses: ./.github/actions/setup-python + - name: Set up Python + uses: ./.github/actions/setup-python - - name: Run linter - run: | - black --check . + - name: Run linter + run: | + black --check . docs: name: "Build documentation" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + + - name: Set up Graphviz + uses: ts-graphviz/setup-graphviz@v1 - - name: Set up Graphviz - uses: ts-graphviz/setup-graphviz@v1 + - name: Set up Python + uses: ./.github/actions/setup-python - - name: Set up Python - uses: ./.github/actions/setup-python + - name: Build documentation + run: make clean-docs build-docs - - name: Build documentation - run: make clean-docs build-docs + - name: Publish documentation to Github Pages + if: ${{ github.ref == 'refs/heads/master' }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build - - name: Publish documentation to Github Pages - if: ${{ github.ref == 'refs/heads/master' }} - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/build + lighthouseci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm install && npm install -g @lhci/cli@0.13.x + - run: npm run build + - run: lhci autorun diff --git a/lighthouserc.js b/lighthouserc.js new file mode 100644 index 0000000000..79c1d8723c --- /dev/null +++ b/lighthouserc.js @@ -0,0 +1,7 @@ +module.exports = { + ci: { + upload: { + target: "temporary-public-storage", + }, + }, +};