Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
GitHub actions added (#969)
Browse files Browse the repository at this point in the history
* GitHub actions added

* danger ci test simlified

* small github actions fix

* init new function bug fixed
  • Loading branch information
volovyks authored May 19, 2022
1 parent 07c809d commit b442f86
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 19 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Danger
on: push
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: yarn
- name: Run Danger
run: yarn danger ci
11 changes: 11 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Linter
on: push
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: yarn
- name: Run ESLint
run: yarn lint --max-warnings 0
19 changes: 19 additions & 0 deletions .github/workflows/test-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Tests
on: push
jobs:
tests:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "12"
- name: Install modules
run: yarn
- name: Run tests
env:
NODE_ENV: ci
run: yarn test
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# NEAR CLI (command line interface)

[![Build Status](https://travis-ci.com/near/near-cli.svg?branch=master)](https://travis-ci.com/near/near-cli)
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/near/near-cli)

NEAR CLI is a Node.js application that relies on [`near-api-js`](https://github.com/near/near-api-js) to connect to and interact with the NEAR blockchain. Create accounts, access keys, sign & send transactions with this versatile command line interface tool.
Expand Down
1 change: 0 additions & 1 deletion bin/near-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ const deploy = {
.option('initFunction', {
desc: 'Initialization method',
type: 'string',
default: 'new'
})
.option('initArgs', {
desc: 'Initialization arguments',
Expand Down
5 changes: 4 additions & 1 deletion commands/dev-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = {
.option('initFunction', {
desc: 'Initialization method',
type: 'string',
default: 'new'
})
.option('initArgs', {
desc: 'Initialization arguments',
Expand Down Expand Up @@ -85,6 +84,10 @@ async function devDeploy(options) {
// Deploy with init function and args
const actions = [transactions.deployContract(readFileSync(options.wasmFile))];

if (options.initArgs && !options.initFunction) {
options.initFunction = 'new';
}

if (options.initFunction) {
if (!options.initArgs) {
await eventtracking.track(eventtracking.EVENT_ID_DEPLOY_END, { success: false, error: 'Must add initialization arguments' }, options);
Expand Down
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ exports.deploy = async function (options) {
// Deploy with init function and args
const txs = [transactions.deployContract(fs.readFileSync(options.wasmFile))];

if (options.initArgs && !options.initFunction) {
options.initFunction = 'new';
}

if (options.initFunction) {
if (!options.initArgs) {
console.error('Must add initialization arguments.\nExample: near deploy --accountId near.testnet --initFunction "new" --initArgs \'{"key": "value"}\'');
Expand Down

0 comments on commit b442f86

Please sign in to comment.