-
-
Notifications
You must be signed in to change notification settings - Fork 175
120 lines (103 loc) · 3.12 KB
/
ci.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
111
112
113
114
115
116
117
118
119
120
name: CI
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
env:
CODECOV_UNIQUE_NAME: CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }}
jobs:
code-quality-checks:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Corepack enable
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Linting and Formatting checks
run: yarn run lint
- name: Type checking
run: yarn run typecheck
testing-and-coverage:
name: Testing and Coverage
needs: [code-quality-checks]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Corepack enable
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Run development server
run: yarn run dev &
- name: Run tests and generate coverage report
run: yarn run test:coverage:all
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4.6.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ env.CODECOV_UNIQUE_NAME }}
verbose: true
fail_ci_if_error: true
check-unauthorized-file-changes:
name: Check Unauthorized File Changes
if: ${{github.actor != 'dependabot[bot]'}} && ${{github.event_name == 'pull_request'}}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get Changed Unauthorized files
id: changed-unauth-files
uses: tj-actions/changed-files@v45
with:
files: |
.github/**
.husky/**
.env.example
package.json
tsconfig.json
next.config.js
next-sitemap.config.js
next-env.d.ts
tailwind.config.js
postcss.config.js
yarn.lock
Dockerfile
CODEOWNERS
LICENSE
.gitignore
.gitmodules
.gitattributes
.eslintrc.js
.eslintignore
.zshrc
.prettierrc
.prettierignore
.dockerignore
makefile
- name: List all changed unauthorized files
if: steps.changed-unauth-files.outputs.any_changed == 'true' || steps.changed-unauth-files.outputs.any_deleted == 'true'
env:
CHANGED_UNAUTH_FILES: ${{ steps.changed-unauth-files.outputs.all_changed_files }}
run: |
for file in ${CHANGED_UNAUTH_FILES}; do
echo "$file is unauthorized to change/delete"
done
exit 1