forked from cardano-foundation/cardano-rosetta
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'postman_send_transaction_example.yml' workflow file
- Loading branch information
James Browning
committed
Apr 6, 2021
1 parent
0d20672
commit 635bdd8
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Postman Send Transaction Example | ||
|
||
on: | ||
schedule: | ||
- cron: '0 1 * * *' | ||
push: | ||
branches: | ||
- feat/postman-examples | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deployed-env-checks: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout Rosetta | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
|
||
- name: Install newman | ||
run: npm i newman | ||
|
||
- name: Set private key | ||
env: | ||
PRIVATE_KEY: ${{ secrets.POSTMAN_SEND_TRANSACTION_EXAMPLE_PRIVATE_KEY }} | ||
working-directory: ./examples/postman | ||
run: jq "(.values[] | select(.key==\"privateKey\") | .value) |= \"$PRIVATE_KEY\"" send_transaction_postman_environment.json > ./temp_env.json && mv ./temp_env.json ./send_transaction_postman_environment.json | ||
|
||
- name: DEBUG | ||
working-directory: ./examples/postman | ||
run: cat send_transaction_postman_environment.json | ||
|
||
- name: Run Signing Server | ||
working-directory: ./examples/postman | ||
run: npm i && node sign-transaction-server & | ||
|
||
- name: Run Send Transaction Example | ||
working-directory: ./examples/postman | ||
run: node send-transaction-example send_transaction_postman_environment.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const newman = require('newman'); | ||
|
||
const env = process.argv[2] | ||
|
||
newman.run({ | ||
collection: require('./send_transaction_ci.postman_collection.json'), | ||
environment: require(`./${env}`), | ||
reporters: ['cli', 'json'] | ||
}, function (err, summary) { | ||
if (err) { | ||
console.error('collection run encountered an error.'); | ||
} else if (summary.run.failures.length) { | ||
console.error('assertion failure occured.'); | ||
process.exit(1); | ||
} | ||
console.log('collection run complete!'); | ||
}); |
File renamed without changes.