-
Notifications
You must be signed in to change notification settings - Fork 7
86 lines (78 loc) · 2.66 KB
/
lint-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
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
83
84
85
86
name: Lint and Test from Root
# run CI on pushes to master, and on all PRs (even the ones that target other
# branches)
on:
push:
branches: [master]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout dapp
uses: actions/checkout@v2
with:
path: 'testnet-load-generator'
# Select a branch on agoric-sdk to test against by adding text to the body of the
# pull request. For example: #agoric-sdk-branch: zoe-release-0.7.0
# The default is 'master'
- name: Get the appropriate agoric-sdk branch
id: get-sdk-branch
uses: actions/[email protected]
with:
result-encoding: string
script: |
let branch = 'master';
if (context.payload.pull_request) {
const { body } = context.payload.pull_request;
const regex = /.*\#agoric-sdk-branch:\s+(\S+)/;
const result = regex.exec(body);
if (result) {
branch = result[1];
}
}
console.log(branch);
return branch;
- name: Checkout agoric-sdk
uses: actions/checkout@v2
with:
repository: Agoric/agoric-sdk
submodules: 'true'
path: agoric-sdk
ref: ${{steps.get-sdk-branch.outputs.result}}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "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.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup and link agoric-sdk packages
run: |
yarn install --frozen-lockfile
yarn build
yarn link-cli $HOME/bin/agoric
echo "$HOME/bin" >> $GITHUB_PATH
working-directory: agoric-sdk
- name: agoric install
run: agoric install
working-directory: testnet-load-generator
- name: yarn build
run: yarn build
working-directory: testnet-load-generator
- name: yarn lint
run: yarn lint
working-directory: testnet-load-generator
- name: yarn test (everything)
run: yarn test
working-directory: testnet-load-generator