Skip to content

v2.0.0

Latest

Choose a tag to compare

@pshevche pshevche released this 14 Sep 18:45
· 21 commits to main since this release
v2.0.0
4f42e0b

What's Changed

🌟 New features

  • Rename npm package from @pshevche/act-test-runner to act-test-runner by @pshevche in #208
  • Capture details about steps the job ran by @pshevche in #200
  • Capture matrix values the job ran with by @pshevche in #197
  • Support listening to the act output stream by @pshevche in #175
  • Support supplying a custom act executable by @pshevche in #163
  • Support aborting a running act invocation via AbortSignal by @pshevche in #195

🛠️ Fixes

  • Remove act containers upon workflow failure by @pshevche in #167
  • Make withEnv and similar builder methods override values instead of merging them by @pshevche in #199
  • Reject additional arguments that are managed via explicit runner builder methods by @pshevche in #166
  • Guard against reusing an ActRunner instance across multiple run() calls by @pshevche in #187
  • Reject clearly when the act process fails to launch by @pshevche in #186
  • Remove noise log around creating temporary files by @pshevche in #154

👜 Misc

  • [Dependencies] Move @octokit/webhooks-types to peerDependencies by @smashercosmo in #157
  • [Docs] Move detailed usage docs from README to the wiki by @pshevche in #202

❗ BREAKING CHANGES

Package rename

The npm package name changed from @pshevche/act-test-runner to the unscoped act-test-runner. I realized late that the scoped package name was not the right decision right from the start, and I am using this major release to revisit that decision. To simplify the migration, the 2.0.0 release will be available under both names. To migrate, update your package.json to pull in the new package and reference the new package name in your imports:

// before
import { ActRunner, ActExecStatus } from '@pshevche/act-test-runner';

// after
import { ActRunner, ActExecStatus } from 'act-test-runner';

Public API changes

Personal note: In this release, the public act-test-runner API received a major revamp. The previous version was heavily influenced by my Java background and often felt clunky in the context of Typescript. As I learned more about how the library is used and idiomatic TS constructs, I decided to revisit it for the 2.0.0 release. See the list below for all changes made and how to migrate. Enjoy! 😅

  1. ActRunner#withWorkflowBody and ActRunner#withWorkflowFile are merged into a single `ActRunner#withWorkflow
// before
.withWorkflowFile(path)
.withWorkflowBody(body)

// after
.withWorkflow({ file: path })
.withWorkflow({ body: body })
  1. Workflow input setters, such as ActRunner#withEnvFile and ActRunner#withEnvValues, are merged into a single setter method
// before
.withEnvFile(path)
.withEnvValues({ GREETING: 'Hello' })

// after
.withEnv({ file: path })
.withEnv({ values: { GREETING: 'Hello' } })
  1. ActRunner#withCacheServer and ActRunner#withArtifactServer take an options object instead of optional positional arguments
// before
.withCacheServer(path, host, port)

// after
.withCacheServer({ path, host, port })
  1. ActWorkflowExecResult.jobs is now a Record instead of Map with job(name) accessor
// before
result.jobs.size
result.job('my_job')

// after
Object.keys(result.jobs).length
result.jobs['my_job']

Full Changelog: v1.1.0...v2.0.0