Skip to content

Commit

Permalink
SYS-197 added ci and fixed things to make the ci work
Browse files Browse the repository at this point in the history
  • Loading branch information
TieDyedSheep committed May 23, 2024
1 parent d40eae0 commit bf7fa3d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"plugin:security/recommended",
"prettier"
],
"ignorePatterns": ["index.ts", "types.ts", "src/util/*.ts", "test/*"],
"ignorePatterns": ["index.ts", "src/util/*.ts", "test/*"],
"rules": {
"no-empty": [
1,
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Node CI Workflow

on:
push:
branches:
- dev
pull_request:
branches:
- dev
workflow_dispatch:
inputs:
workflowBranch:
description: 'Select the branch to run the workflow on'
required: true
default: 'main'
type: choice
options:
- dev
- main
jobs:
ci-dev:
if: ${{ github.event.inputs.workflowBranch == 'dev' }}
uses: shardeum/github-automation/.github/workflows/node-ci-shared.yml@dev

ci-main:
if: ${{ github.event.inputs.workflowBranch == 'main' || !github.event.inputs.workflowBranch }}
uses: shardeum/github-automation/.github/workflows/node-ci-shared.yml@main
66 changes: 0 additions & 66 deletions .gitlab-ci.yml

This file was deleted.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
"release": "np --no-cleanup --no-yarn --any-branch",
"prepack": "npm run build-node",
"postinstall": "npm run build-rust",
"test": "cargo test",
"test": "npm run test:cargo",
"test2": "ts-node test/test_lru.ts -p 44001 -c 2",
"test:cargo": "cargo test",
"build:rust": "cargo build --workspace && npm run postbuild-cargo",
"postbuild-cargo": "node scripts/copy-rename.js",
"lint": "eslint ./src/**/*.ts --quiet",
"lint-windows": "eslint ./src/**/*.ts --quiet",
"format-check": "prettier --check './src/**/*.ts'",
"lint": "eslint \"./src/**/*.ts\"",
"format-check": "prettier --check \"./src/**/*.ts\"",
"clean": "cargo clean"
},
"repository": {
"type": "git",
"url": "https://gitlab.com/Shardus/shardus-net.git"
"url": "https://github.com/shardeum/lib-net.git"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const Sn = (opts: SnOpts) => {
sendCallback
)
}
} else{
} else {
/* prettier-ignore */ if(logFlags.net_verbose) console.log('sending without header')
_net.send(port, address, stringifiedData, sendCallback)
}
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export type SnOpts = {
* @param opts - The options object to validate.
* @throws An error if the options object is not valid.
*/
export const validateSnOpts = (opts: SnOpts) => {
export const validateSnOpts = (opts: SnOpts): void => {
if (!opts) throw new Error('snq: must supply options')

if (!opts.port || typeof opts.port !== 'number') throw new Error('snq: must supply port')
Expand Down

0 comments on commit bf7fa3d

Please sign in to comment.