-
Notifications
You must be signed in to change notification settings - Fork 64
58 lines (49 loc) · 1.45 KB
/
test-and-build-from-fork.yaml
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
name: Test and Build (from fork)
on:
pull_request_target:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
test-and-build:
name: Test and Build
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js Environment
uses: actions/setup-node@v4
with:
node-version: 20.16.0
- name: Install Dependencies
run: npm ci --omit=optional
- name: Run Checks
run: npm run check
# the glob here just fails
if: ${{ runner.os != 'Windows' }}
- name: Run Tests
env:
NODE_OPTIONS: "--max_old_space_size=4096"
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY_DEV }}
run: npm run test
merge-dependabot-pr:
name: Merge Dependabot PR
runs-on: ubuntu-latest
needs:
- test-and-build
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}