Skip to content

Commit ef83840

Browse files
committed
Simplify and streamline CI workflow
Refactors the GitHub Actions CI workflow by consolidating and simplifying job steps, removing redundant jobs (formatting, security scan, and status check), and improving caching logic. The workflow now focuses on linting, type checking, and building, with clearer step names and more concise configuration.
1 parent 354a79c commit ef83840

1 file changed

Lines changed: 26 additions & 139 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -8,177 +8,64 @@ on:
88

99
jobs:
1010
lint-and-type-check:
11-
name: Lint and Type Check
11+
name: Lint & Type Check
1212
runs-on: ubuntu-latest
13-
13+
1414
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v4
15+
- uses: actions/checkout@v4
1716

18-
- name: Setup Node.js
19-
uses: actions/setup-node@v4
17+
- uses: actions/setup-node@v4
2018
with:
2119
node-version: '20'
2220

23-
- name: Setup pnpm
24-
uses: pnpm/action-setup@v2
21+
- uses: pnpm/action-setup@v2
2522
with:
2623
version: 8
2724

28-
- name: Get pnpm store directory
29-
id: pnpm-cache
30-
shell: bash
31-
run: |
32-
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
33-
34-
- name: Setup pnpm cache
25+
- name: Cache pnpm
3526
uses: actions/cache@v4
3627
with:
37-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
38-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
39-
restore-keys: |
40-
${{ runner.os }}-pnpm-store-
28+
path: ~/.pnpm-store
29+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
30+
restore-keys: ${{ runner.os }}-pnpm-
4131

42-
- name: Install dependencies
43-
run: pnpm install --frozen-lockfile
32+
- run: pnpm install --frozen-lockfile
4433

45-
- name: Run ESLint
46-
run: pnpm lint || echo "ESLint found issues but continuing..."
34+
- name: ESLint
35+
run: pnpm lint
4736
continue-on-error: true
4837

49-
- name: Type check
50-
run: pnpm tsc --noEmit || echo "TypeScript check found issues but continuing..."
38+
- name: TypeScript
39+
run: pnpm tsc --noEmit
5140
continue-on-error: true
5241

5342
build:
5443
name: Build
5544
runs-on: ubuntu-latest
5645
needs: lint-and-type-check
57-
46+
5847
steps:
59-
- name: Checkout code
60-
uses: actions/checkout@v4
48+
- uses: actions/checkout@v4
6149

62-
- name: Setup Node.js
63-
uses: actions/setup-node@v4
50+
- uses: actions/setup-node@v4
6451
with:
6552
node-version: '20'
6653

67-
- name: Setup pnpm
68-
uses: pnpm/action-setup@v2
54+
- uses: pnpm/action-setup@v2
6955
with:
7056
version: 8
7157

72-
- name: Get pnpm store directory
73-
id: pnpm-cache
74-
shell: bash
75-
run: |
76-
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
77-
78-
- name: Setup pnpm cache
58+
- name: Cache pnpm
7959
uses: actions/cache@v4
8060
with:
81-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
82-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
83-
restore-keys: |
84-
${{ runner.os }}-pnpm-store-
85-
86-
- name: Install dependencies
87-
run: pnpm install --frozen-lockfile
88-
89-
- name: Create .env.local for build
90-
run: |
91-
cat > .env.local << EOF
92-
NEXT_PUBLIC_SUPABASE_URL=https://placeholder.supabase.co
93-
NEXT_PUBLIC_SUPABASE_ANON_KEY=placeholder-key
94-
OLLAMA_URL=http://localhost:11434
95-
OLLAMA_MODEL=deepseek-r1:7b
96-
EOF
97-
98-
- name: Build Next.js app
61+
path: ~/.pnpm-store
62+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
63+
restore-keys: ${{ runner.os }}-pnpm-
64+
65+
- run: pnpm install --frozen-lockfile
66+
67+
- name: Build
9968
run: pnpm build
10069
env:
10170
NEXT_PUBLIC_SUPABASE_URL: https://placeholder.supabase.co
10271
NEXT_PUBLIC_SUPABASE_ANON_KEY: placeholder-key
103-
104-
check-format:
105-
name: Check Code Formatting
106-
runs-on: ubuntu-latest
107-
108-
steps:
109-
- name: Checkout code
110-
uses: actions/checkout@v4
111-
112-
- name: Setup Node.js
113-
uses: actions/setup-node@v4
114-
with:
115-
node-version: '20'
116-
117-
- name: Setup pnpm
118-
uses: pnpm/action-setup@v2
119-
with:
120-
version: 8
121-
122-
- name: Install dependencies
123-
run: pnpm install --frozen-lockfile
124-
125-
- name: Check formatting (if prettier is configured)
126-
run: |
127-
if command -v prettier &> /dev/null; then
128-
echo "Prettier found, checking formatting..."
129-
pnpm prettier --check . || echo "Formatting issues found but continuing..."
130-
else
131-
echo "Prettier not installed, skipping format check"
132-
fi
133-
shell: bash
134-
continue-on-error: true
135-
136-
security-scan:
137-
name: Security Scan
138-
runs-on: ubuntu-latest
139-
140-
steps:
141-
- name: Checkout code
142-
uses: actions/checkout@v4
143-
144-
- name: Setup Node.js
145-
uses: actions/setup-node@v4
146-
with:
147-
node-version: '20'
148-
149-
- name: Setup pnpm
150-
uses: pnpm/action-setup@v2
151-
with:
152-
version: 8
153-
154-
- name: Install dependencies
155-
run: pnpm install --frozen-lockfile
156-
157-
- name: Run security audit
158-
run: pnpm audit --audit-level=high
159-
continue-on-error: true
160-
161-
status-check:
162-
name: All Checks Passed
163-
runs-on: ubuntu-latest
164-
needs: [lint-and-type-check, build, check-format, security-scan]
165-
if: always()
166-
167-
steps:
168-
- name: Check status
169-
run: |
170-
echo "Lint and Type Check: ${{ needs.lint-and-type-check.result }}"
171-
echo "Build: ${{ needs.build.result }}"
172-
echo "Check Format: ${{ needs.check-format.result }}"
173-
echo "Security Scan: ${{ needs.security-scan.result }}"
174-
175-
if [ "${{ needs.build.result }}" != "success" ]; then
176-
echo "Build failed! This is required."
177-
exit 1
178-
fi
179-
180-
if [ "${{ needs.lint-and-type-check.result }}" != "success" ]; then
181-
echo "Lint/Type check had issues (non-blocking)"
182-
fi
183-
184-
echo "All required checks passed!"

0 commit comments

Comments
 (0)