Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stepci/runner

Package Overview
Dependencies
Maintainers
0
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stepci/runner

Step CI Runner

  • 2.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.8K
decreased by-5.6%
Maintainers
0
Weekly downloads
 
Created
Source

Step CI Runner

Step CI Test Runner

Installation

npm install @stepci/runner

Usage

Run workflow from file

import { runFromFile } from '@stepci/runner'
runFromFile('./examples/status.yml').then(console.log)

Run workflow from config

import { run } from '@stepci/runner'

// Example workflow
const workflow = {
  version: "1.0",
  name: "Status Test",
  env: {
    host: "example.com"
  },
  tests: {
    example: {
      steps: [{
        name: "GET request",
        http: {
          url: "https://${{env.host}}",
          method: "GET",
          check: {
            status: "/^20/"
          }
        }
      }]
    }
  }
}

run(workflow).then(console.log)

Events

If you supply an EventEmitter as argument, you can subscribe to following events:

  • step:http_request, when a http request is made
  • step:http_response, when a http response is received
  • step:grpc_request, when a grpc request is made
  • step:grpc_response, when a grpc is received
  • step:result, when step finishes
  • step:error, when step errors
  • test:result, when test finishes
  • workflow:result, when workflow finishes
  • loadtest:result, when loadtest finishes

Example: Events

import { run } from '@stepci/runner'
import { EventEmitter } from 'node:events'

// Example workflow
const workflow = {
  version: "1.0",
  name: "Status Test",
  env: {
    host: "example.com"
  },
  tests: {
    example: {
      steps: [{
        name: "GET request",
        http: {
          url: "https://${{env.host}}",
          method: "GET",
          check: {
            status: "/^20/"
          }
        }
      }]
    }
  }
}

const ee = new EventEmitter()
ee.on('done', console.log)
run(workflow, { ee })

Keywords

FAQs

Package last updated on 22 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc