-
-
Notifications
You must be signed in to change notification settings - Fork 958
110 lines (110 loc) · 4.28 KB
/
pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
##############################################################################
##############################################################################
#
# NOTE!
#
# Please read the README.md file in this directory that defines what should
# be placed in this file.
#
##############################################################################
##############################################################################
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."
exit 1
check_code_quality:
name: Checking code quality
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v4.2.2
- 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
check_gql_tada:
name: Check gql tada files and configuration
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v4.2.2
- 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/checkout@v4.2.2
- 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/checkout@v4.2.2
- 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_unauthorized_file_changes:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Check if there are unauthorized file changes
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v4.2.2
- id: changed_files
name: Get changed files
uses: tj-actions/changed-files@v45.0.4
with:
files: |
.coderabbit.yaml
.github/**
biome.jsonc
drizzle_migrations/**
CODEOWNERS
LICENSE
tsconfig.json
vitest.config.ts
- 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/checkout@v4.2.2
- 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
name: Pull request workflow
on:
pull_request:
branches:
- "**"