Biome linting disable check script #4954
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
############################################################################## | |
############################################################################## | |
# | |
# NOTE! | |
# | |
# Please read the README.md file in this directory that defines what should | |
# be placed in this file. | |
# | |
############################################################################## | |
############################################################################## | |
name: Pull request workflow | |
on: | |
pull_request: | |
branches: | |
- "**" | |
jobs: | |
check_base_branch: | |
# only run the job if the pull request actor is not dependabot | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
name: Check base branch of the pull request to be develop-postgres | |
runs-on: ubuntu-latest | |
steps: | |
- if: github.event.pull_request.base.ref != 'develop-postgres' | |
name: Check base branch | |
run: | | |
echo "Pull requests are only allowed against the 'develop-postgres' branch. Please refer to the pull request guidelines." | |
echo "Error: Close this PR and try again." | |
exit 1 | |
check_code_quality: | |
name: Checking code quality | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/[email protected] | |
- name: Build talawa api non production environment docker image | |
run: docker buildx build --file ./docker/api.Containerfile --tag talawa_api --target non_production ./ | |
- name: Check type errors | |
run: docker container run talawa_api pnpm check_code_quality | |
- name: Check if the source and target branches are different | |
if: ${{ github.event.pull_request.base.ref == github.event.pull_request.head.ref }} | |
run: | | |
echo "Source Branch ${{ github.event.pull_request.head.ref }}" | |
echo "Target Branch ${{ github.event.pull_request.base.ref }}" | |
echo "Error: Source and Target Branches are the same. Please ensure they are different." | |
echo "Error: Close this PR and try again." | |
exit 1 | |
check_biome_ignore: | |
name: Check for biome_ignore | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v45 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Run Python script | |
run: | | |
python .github/workflows/scripts/biome_disable_check.py --files ${{ steps.changed-files.outputs.all_changed_files }} | |
check_code_coverage_disable: | |
name: Check for code coverage disable | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v45 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Run Python script | |
run: | | |
python .github/workflows/scripts/code_coverage_disable_check.py --files ${{ steps.changed-files.outputs.all_changed_files }} | |
check_gql_tada: | |
name: Check gql tada files and configuration | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/[email protected] | |
- name: Build talawa api non production environment docker image | |
run: docker buildx build --file ./docker/api.Containerfile --tag talawa_api --target non_production ./ | |
- name: Check gql tada | |
run: docker container run talawa_api pnpm check_gql_tada | |
check_drizzle_migrations: | |
name: Check drizzle migration files | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/[email protected] | |
- name: Build talawa api non production environment docker image | |
run: docker buildx build --file ./docker/api.Containerfile --tag talawa_api --target non_production ./ | |
- name: Check drizzle migrations | |
run: docker container run --env-file ./envFiles/.env.ci talawa_api pnpm check_drizzle_migrations | |
check_type_errors: | |
name: Check type errors | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/[email protected] | |
- name: Build talawa api non production environment docker image | |
run: docker buildx build --file ./docker/api.Containerfile --tag talawa_api --target non_production ./ | |
- name: Check type errors | |
run: docker container run talawa_api pnpm check_type_errors | |
Check-Sensitive-Files: | |
if: ${{ github.actor != 'dependabot[bot]' && !contains(github.event.pull_request.labels.*.name, 'ignore-sensitive-files-pr') }} | |
name: Checks if sensitive files have been changed without authorization | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/[email protected] | |
- id: changed_files | |
name: Get changed files | |
uses: tj-actions/[email protected] | |
with: | |
files: | | |
.coderabbit.yaml | |
.github/** | |
biome.jsonc | |
drizzle_migrations/** | |
CODEOWNERS | |
LICENSE | |
tsconfig.json | |
vitest.config.ts | |
pnpm-lock.yaml | |
package.json | |
.nojekyll | |
docs/docusaurus.config.ts | |
docs/sidebar* | |
CNAME | |
- env: | |
CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }} | |
if: steps.changed_files.outputs.any_changed == 'true' || steps.changed_files.outputs.any_deleted == 'true' | |
name: Show changed files | |
run: | | |
echo "Unauthorized changes were made in the following files:" | |
for FILE in ${CHANGED_FILES}; do | |
echo "$FILE" | |
done | |
echo "To override this, apply the 'ignore-sensitive-files-pr' label" | |
exit 1 | |
Run-Tests: | |
name: Run tests for talawa api | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/[email protected] | |
- name: Create .env file for talawa api testing environment | |
run: cp ./envFiles/.env.ci ./.env | |
- name: Build talawa api compose testing environment | |
run: docker compose build | |
- name: Run tests | |
run: docker compose up --exit-code-from api | |
Test-Docusaurus-Deployment: | |
name: Test Deployment to https://docs-api.talawa.io | |
runs-on: ubuntu-latest | |
needs: [Run-Tests] | |
# Run only if the develop-postgres branch and not dependabot | |
if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.base.ref == 'develop-postgres' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
cache: pnpm | |
cache-dependency-path: | | |
docs/pnpm-lock.yaml | |
docs/package.json | |
# Run Docusaurus in the ./docs directory | |
- name: Install dependencies | |
working-directory: ./docs | |
run: pnpm install --frozen-lockfile | |
- name: Test building the website | |
working-directory: ./docs | |
run: pnpm build |