-
Notifications
You must be signed in to change notification settings - Fork 207
82 lines (72 loc) · 2.31 KB
/
test-dapp-simple-exchange.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 Simple Exchange
on:
pull_request:
merge_group:
schedule:
- cron: '17 6 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-dapp:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16.x']
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
path: ./agoric-sdk
- uses: ./agoric-sdk/.github/actions/restore-node
with:
node-version: ${{ matrix.node-version }}
path: ./agoric-sdk
- name: yarn link
run: |
yarn link-cli ~/bin/agoric
echo "/home/runner/bin" >> $GITHUB_PATH
working-directory: ./agoric-sdk
# 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@v6
with:
result-encoding: string
script: |
let branch = 'main';
if (context.payload.pull_request) {
const { body } = context.payload.pull_request;
const regex = /^\#dapp-simple-exchange-branch:\s+(\S+)/m;
const result = regex.exec(body);
if (result) {
branch = result[1];
}
}
console.log(branch);
return branch;
- name: Check out dapp
uses: actions/checkout@v3
with:
repository: Agoric/dapp-simple-exchange
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
- name: notify on failure
if: failure() && github.event_name != 'pull_request'
uses: ./.github/actions/notify-status
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}