Skip to content

Commit

Permalink
Add Github Action Workflow for all dapps (#1901)
Browse files Browse the repository at this point in the history
* chore: add github action workflows based on the test dapp template for all dapps

* chore: remove dapp-token-economy
  • Loading branch information
katelynsills authored Oct 23, 2020
1 parent 48033d7 commit 559c5ed
Show file tree
Hide file tree
Showing 6 changed files with 492 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/test-dapp-autoswap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Test Dapp Autoswap

# 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-autoswap-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-autoswap
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
82 changes: 82 additions & 0 deletions .github/workflows/test-dapp-card-store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Test Dapp Card Store

# 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-card-store-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-card-store
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
82 changes: 82 additions & 0 deletions .github/workflows/test-dapp-fungible-faucet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Test Dapp Fungible Faucet

# 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-fungible-faucet-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-fungible-faucet
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
82 changes: 82 additions & 0 deletions .github/workflows/test-dapp-oracle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
Loading

0 comments on commit 559c5ed

Please sign in to comment.