Skip to content

Commit

Permalink
Chore/ Add smoke test to CLI (#132)
Browse files Browse the repository at this point in the history
* Use npm publish instead of yarn

* Switch CLI to use yarn

* Switch to cross-fetch

* Style fixes

* Adds test suite, updates docs, and makes some minor structural changes

* Add linting to cli
  • Loading branch information
rhyslbw authored Mar 25, 2020
1 parent 813ca91 commit 352b4ac
Show file tree
Hide file tree
Showing 11 changed files with 4,812 additions and 1,097 deletions.
7 changes: 5 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ pipeline {
stage('Install') {
steps {
sh 'yarn'
sh 'yarn --cwd ./cli'
}
}
stage('Validate Code Style') {
steps {
sh 'yarn lint'
sh 'yarn --cwd ./cli lint'
}
}
stage('Test') {
steps {
sh 'yarn start:sample-stack --build -d'
sh 'yarn test:e2e'
sh 'yarn --cwd ./cli test'
}
post {
always {
Expand Down Expand Up @@ -67,8 +70,8 @@ pipeline {
sh "docker tag inputoutput/cardano-graphql:${env.GIT_COMMIT} inputoutput/cardano-graphql:${env.TAG_NAME}"
sh "docker push inputoutput/cardano-graphql:${env.TAG_NAME}"
sh "npx npm-auth --secure-token=$NPM_REGISTRY_AUTH_USR --email=$NPM_REGISTRY_AUTH_PSW --registry=$NPM_REGISTRY_URI"
sh "yarn --cwd ./cli publish"
sh "yarn --cwd ./generated_packages/TypeScript publish"
sh "npm publish --cwd ./cli"
sh "npm publish publish --cwd ./generated_packages/TypeScript"
}
post {
always {
Expand Down
3 changes: 1 addition & 2 deletions cli/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
dist
docker-compose.yml
bin
19 changes: 17 additions & 2 deletions cli/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Cardano GraphQL CLI
## Global install from [npm](https://www.npmjs.com/package/cardano-graphql-cli)
```
npm i -g
npm i -g cardano-graphql-cli
cgql --help
```
Also available on [npm](https://www.npmjs.com/package/cardano-graphql-cli)
## Execute without installing using [npx](https://nodejs.dev/the-npx-nodejs-package-runner)
```
npx cardano-graphql-cli --help
```
## Build from source using yarn
```
yarn & yarn add-global
cgql --help
```
Depending on your local environment, you may need to add the yarn global bin to your PATH. The
following command is useful for a single terminal session:
```
export PATH="$(yarn global bin):$PATH"
cgql --help
```
6 changes: 6 additions & 0 deletions cli/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
"transform": {
"^.+\\.test.ts?$": "ts-jest"
},
preset: 'ts-jest'
}
Loading

0 comments on commit 352b4ac

Please sign in to comment.