-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (32 loc) · 990 Bytes
/
build_test.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
name: Build Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint-and-format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: yarn install
- name: Run Build
run: yarn build:weapp
- name: Check for merge conflicts
if: github.event_name == 'pull_request'
run: |
git fetch --no-tags --prune origin +refs/heads/*:refs/remotes/origin/*
git checkout -qf ${{ github.event.pull_request.head.sha }}
git merge-base --is-ancestor origin/main ${{ github.event.pull_request.head.sha }} || git merge --no-commit --no-ff origin/main
if [ $? -ne 0 ]; then
echo "Merge conflicts detected. Please resolve them before merging."
exit 1
fi