diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 000000000..b6b00523a --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -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 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 7e3f67f79..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - schedule: - - cron: '36 16 * * 2' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'javascript', 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/django-test.yml b/.github/workflows/django-test.yml deleted file mode 100644 index ceb81e300..000000000 --- a/.github/workflows/django-test.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Django Test - -on: - push: - pull_request: - -jobs: - build: - 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 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index 55216e186..000000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -########################### -########################### -## Linter GitHub Actions ## -########################### -########################### -name: Lint Code Base - -# -# Documentation: -# https://help.github.com/en/articles/workflow-syntax-for-github-actions -# - -############################# -# Start the job on all push # -############################# -on: - push: - branches-ignore: [master] - # Remove the line above to run when pushing to master - pull_request: - branches: [master] - -############### -# Set the Job # -############### -jobs: - build: - # Name the Job - name: Lint Code Base - # Set the agent to run on - runs-on: ubuntu-latest - - ################## - # Load all steps # - ################## - steps: - ########################## - # Checkout the code base # - ########################## - - name: Checkout Code - uses: actions/checkout@v2 - with: - # Full git history is needed to get a proper list of changed files within `super-linter` - fetch-depth: 0 - - ################################ - # Run Linter against code base # - ################################ - - name: Lint Code Base - uses: github/super-linter@v3.17.0 - env: - VALIDATE_ALL_CODEBASE: false - DEFAULT_BRANCH: master - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index 455c7b98f..000000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Pre-Commit -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' - - - name: Run pre-commit - uses: pre-commit/action@v3.0.1