Step CI Test Runner
npm install @steve.clogic/runner
import { runFromFile } from '@steve.clogic/runner'
runFromFile('./examples/status.yml').then(console.log)import { run } from '@steve.clogic/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)If you supply an EventEmitter as argument, you can subscribe to following events:
step:http_request, when a http request is madestep:http_response, when a http response is receivedstep:grpc_request, when a grpc request is madestep:grpc_response, when a grpc is receivedstep:result, when step finishesstep:error, when step errorstest:result, when test finishesworkflow:result, when workflow finishesloadtest:result, when loadtest finishes
Example: Events
import { run } from '@steve.clogic/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 })This fork uses the upstream version as the base and appends a fork-specific prerelease suffix.
Example:
- upstream:
2.0.7 - fork:
2.0.7-steve.0
- Runner repository:
https://github.com/nzstevec/runner - Paired StepCI package:
@steve.clogic/stepci - Paired StepCI repository:
https://github.com/nzstevec/stepci
Run these checks before publishing a new @steve.clogic/runner version:
- In this repository, run
npm test. - In this repository, run
npm link. - In the
@steve.clogic/stepcirepository, runnpm link @steve.clogic/runner. - In the
@steve.clogic/stepcirepository, runnpm run buildto confirm the linked runner still exposesdist/index.d.tsfor theWorkflowschema build. - Validate tarball installation in a disposable directory by packing both repositories and installing them together, then confirm
@steve.clogic/stepciresolves@steve.clogic/runner. - Publish with
npm publishfrom this repository after the package metadata and smoke tests pass.