This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
Simplify commands used in README instructions #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration Test against Agoric SDK | |
# 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: [18.x] | |
steps: | |
- name: Checkout dapp | |
uses: actions/checkout@v3 | |
# 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 'NONE' | |
- name: Get the appropriate agoric-sdk branch | |
id: get-branch | |
uses: actions/github-script@v6 | |
with: | |
result-encoding: string | |
script: | | |
const { body = '' } = context.payload.pull_request || {}; | |
const regex = /.*\#agoric-sdk-branch:\s+(\S+)/; | |
const match = regex.exec(body); | |
const agoricSdkBranch = match && match[1] || 'NONE'; | |
console.log(agoricSdkBranch); | |
return agoricSdkBranch; | |
- name: Checkout agoric-sdk | |
uses: actions/checkout@v3 | |
if: ${{ steps.get-branch.outputs.result != 'NONE' }} | |
with: | |
repository: Agoric/agoric-sdk | |
path: agoric-sdk | |
ref: ${{steps.get-branch.outputs.result}} | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup and link agoric-sdk packages | |
if: ${{ steps.get-branch.outputs.result != 'NONE' }} | |
run: | | |
yarn install | |
yarn build | |
yarn link-cli ~/bin/agoric | |
echo "/home/runner/bin" >> $GITHUB_PATH | |
working-directory: ./agoric-sdk | |
- name: install packages | |
run: | | |
if ${{ steps.get-branch.outputs.result == 'NONE' }}; then | |
yarn install | |
echo "AGORIC_CMD=[\"$PWD/node_modules/.bin/agoric\"]" >> $GITHUB_ENV | |
else | |
agoric install | |
fi | |
- name: yarn build | |
run: yarn build | |
- name: yarn integration test | |
run: yarn integration-test |