-
Notifications
You must be signed in to change notification settings - Fork 6
89 lines (73 loc) · 2.38 KB
/
Copy pathci.yml
File metadata and controls
89 lines (73 loc) · 2.38 KB
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
name: CI
on:
pull_request:
types: [opened, synchronize]
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-latest
name: Build and Test
steps:
# 1. Check out the repository
- name: Check out source repository
uses: actions/checkout@v3
# 2. Setup Node
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20"
cache: 'yarn'
# 3. Cache node_modules
# - name: Cache Node Modules
# id: node-modules-cache
# uses: actions/cache@v3
# with:
# path: "**/node_modules"
# key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
# 4. Install dependencies (only if no cache was found)
- name: Install dependencies
# if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install
# 5. Check codegen is up to date
- name: Check codegen is up to date
run: |
echo "Running codegen to check if outputs are current..."
yarn generate
echo "Checking if codegen outputs changed..."
if ! git diff --exit-code src/generated/; then
echo "❌ Codegen outputs are outdated!"
echo "The following files have changes:"
git diff --name-only src/generated/
echo ""
echo "Please run 'yarn generate' locally and commit the changes."
exit 1
fi
echo "✅ Codegen outputs are up to date"
# 6. Build only if build artifacts aren't cached
- name: Build
run: yarn build
# 7. Run tests
- name: Run tests
run: yarn test
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20"
cache: 'yarn'
# - name: Cache Node Modules
# id: node-modules-cache-lint
# uses: actions/cache@v3
# with:
# path: "**/node_modules"
# key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
# if: steps.node-modules-cache-lint.outputs.cache-hit != 'true'
run: yarn install
- name: Check Linting errors
run: yarn lint:check-errors-only