-
-
Notifications
You must be signed in to change notification settings - Fork 6
61 lines (54 loc) · 1.67 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
name: Main CI
on: [push, pull_request]
jobs:
build:
name: Build Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Commit Range
id: get_commit_range
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "commit_range=${{ github.event.before }} ${{ github.sha }}" >> $GITHUB_ENV
else
echo "commit_range=${{ github.event.pull_request.base.sha }} ${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Check for changes in UI directory
id: check_changes
run: |
if git diff --quiet ${{ env.commit_range }} -- ui; then
echo "No changes in UI directory. Skipping step."
echo "skip_step=true" >> $GITHUB_ENV
else
echo "Changes detected in UI directory. Proceeding with step."
echo "skip_step=false" >> $GITHUB_ENV
fi
- name: Install pnpm
if: env.skip_step == 'false'
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup node environment
if: env.skip_step == 'false'
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"
cache-dependency-path: "ui/pnpm-lock.yaml"
- name: Install deps
if: env.skip_step == 'false'
run: pnpm install --frozen-lockfile
working-directory: ui
- name: Try build
if: env.skip_step == 'false'
run: pnpm build
working-directory: ui
env:
CI: true