forked from MetaMask/eth-phishing-detect
-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (42 loc) · 1.33 KB
/
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
40
41
42
43
44
45
46
name: Build and Test
on:
push:
branches: [ main ]
pull_request:
jobs:
build-test:
name: Build and Test
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- name: Set Environment Variables
run: |
echo "TMP=${{ runner.temp }}" >> $GITHUB_ENV
if [ "${{ github.event_name }}" == "push" ]; then
echo "BASE_COMMIT=${{ github.event.push.before }}" >> $GITHUB_ENV
echo "HEAD_COMMIT=${{ github.event.push.after }}" >> $GITHUB_ENV
fi
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BASE_COMMIT=${{ github.event.pull_request.base.sha }}" >> $GITHUB_ENV
echo "HEAD_COMMIT=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
fi
- uses: actions/checkout@v4
- run: git fetch origin "$BASE_COMMIT" "$HEAD_COMMIT" --depth 1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn --frozen-lockfile
- run: yarn buildSample
- run: yarn ci
- run: src/compare-git-configs.sh "$BASE_COMMIT" "$HEAD_COMMIT"
all-jobs-pass:
name: All jobs pass
runs-on: ubuntu-20.04
needs:
- build-test
steps:
- run: echo "Great success!"