forked from Agoric/agoric-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (71 loc) · 2.12 KB
/
test-dapp-oracle.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Test Dapp Oracle
# run CI on pushes to master, and on all PRs (even the ones that target other
# branches)
on:
push:
branches: [ $default-branch ]
pull_request:
jobs:
test-dapp:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['14.x']
steps:
- name: Checkout agoric-sdk
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: cache node modules
uses: actions/cache@v1
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Select a branch on dapp to test against by adding text to the body of the
# pull request. For example: #dapp-encouragement-branch: zoe-release-0.7.0
# The default is 'main'
- name: Get the appropriate dapp branch
id: get-branch
uses: actions/github-script@0.9.0
with:
result-encoding: string
script: |
let branch = 'main';
if (context.payload.pull_request) {
const { body } = context.payload.pull_request;
const regex = /.*\#dapp-oracle-branch:\s+(\S+)/;
const result = regex.exec(body);
if (result) {
branch = result[1];
}
}
console.log(branch);
return branch;
- name: yarn install
run: yarn install
# 'yarn build' loops over all workspaces
- name: yarn build
run: yarn build
- name: yarn link
run: |
yarn link-cli ~/bin/agoric
echo "::add-path::/home/runner/bin"
- name: Check out dapp
uses: actions/checkout@v2
with:
repository: Agoric/dapp-oracle
path: dapp
ref: ${{steps.get-branch.outputs.result}}
- name: Agoric install in dapp
run: agoric install
working-directory: ./dapp
- name: yarn build in dapp
run: yarn build
working-directory: ./dapp
- name: yarn test in dapp
run: yarn test
working-directory: ./dapp