Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline CI/CD jobs #1826

Merged
merged 3 commits into from
Feb 25, 2024
Merged
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
74 changes: 74 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI/CD

on:
- merge_group
- pull_request
- push
- workflow_dispatch

env:
FORCE_COLOR: 1

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
pre-commit:
name: Run pre-commit
runs-on: ubuntu-latest
steps:
- name: Check out Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.0.0
with:
python-version: 3.11.2
- name: Run pre-commit
uses: pre-commit/action@v3.0.1

code-ql:
name: Run CodeQL
needs:
- pre-commit
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language:
- 'javascript'
- 'python'

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

test:
name: Run Tests
needs:
- code-ql
runs-on: ubuntu-latest
steps:
- uses: nanasess/setup-chromedriver@v2
- uses: actions/checkout@v2
- name: Set up Python 3.11.2
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: 3.11.2
cache: 'poetry'
- name: Install dependencies
run: poetry install
- name: Collect static files
run: poetry run python manage.py collectstatic --noinput
- name: Run tests
run: poetry run xvfb-run --auto-servernum python manage.py test -v 3 --failfast
67 changes: 0 additions & 67 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/django-test.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/linter.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/pre-commit.yml

This file was deleted.

Loading