-
Notifications
You must be signed in to change notification settings - Fork 212
80 lines (71 loc) · 2.41 KB
/
test-documentation.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
name: Test Documentation
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: ['18.x']
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
path: ./agoric-sdk
- uses: ./agoric-sdk/.github/actions/restore-node
with:
node-version: ${{ matrix.node-version }}
path: ./agoric-sdk
# Select a branch of the
# [documentation repository](https://github.com/Agoric/documentation)
# against which to test, defaulting to 'main' but allowing overrides in
# the pull request description using lines like
# `#documentation-branch: node-22`
- name: Get the appropriate dapp branch
id: get-branch
uses: actions/github-script@v7
with:
result-encoding: string
script: |
let branch = 'main';
if (context.payload.pull_request) {
const { body } = context.payload.pull_request;
const regex = /^\#documentation-branch:\s+(\S+)/m;
const result = regex.exec(body);
if (result) {
branch = result[1];
}
}
console.log('documentation branch: ' + branch);
return branch;
- name: Check out dapp
uses: actions/checkout@v4
with:
repository: Agoric/documentation
path: dapp
ref: ${{steps.get-branch.outputs.result}}
- name: point dapp to agoric-SDK HEAD
# This assumes the dapp uses Yarn 4 and its other deps are compatible
# with the versions in the agoric-sdk packages.
run: yarn link ../agoric-sdk --all --relative
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: ./agoric-sdk/.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 }}