-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.71 KB
/
unit-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
47
48
49
50
51
52
53
54
55
56
57
name: Unit Tests
on:
pull_request:
push:
branches:
- dev
- main
jobs:
unit-tests:
runs-on: [self-hosted, linux]
strategy:
fail-fast: true
matrix:
node: [18]
name: Unit tests (Jest)
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 18.x
registry-url: 'https://npm.pkg.github.com'
scope: '@astraprotocol'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: |
npm install -g yarn
echo yarn-cache-dir="$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup npm token
run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.GITHUB_TOKEN}}"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests
run: yarn test
env:
NEXT_PUBLIC_ENV: mainnet
NEXT_PUBLIC_WASA_ADDRESS: '0x6637D8275DC58983Cb3A2fa64b705EC11f6EC670'