Skip to content

Commit

Permalink
feat: continued action implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Dec 1, 2023
1 parent c920e5a commit d1235da
Show file tree
Hide file tree
Showing 16 changed files with 610 additions and 96 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,4 @@ __tests__/runner/*
test-report.xml

# Generated code
gen/

src/gen/
15 changes: 12 additions & 3 deletions __tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@

import * as main from '../src/main'

// Mock the action's entrypoint
const runMock = jest.spyOn(main, 'run').mockImplementation()
const runMock = jest.spyOn(main, 'entry').mockImplementation()
const cleanupMock = jest.spyOn(main, 'cleanup').mockImplementation()

describe('index', () => {
it('calls run when imported', async () => {
it('calls entrypoint when imported', async () => {
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('../src/index')

expect(runMock).toHaveBeenCalled()
})
})

describe('cleanup', () => {
it('calls entrypoint when imported', async () => {
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('../src/cleanup')

expect(cleanupMock).toHaveBeenCalled()
})
})
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ outputs:
runs:
using: node20
main: dist/index.js
post: dist/cleanup.js
5 changes: 2 additions & 3 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ version: v1
plugins:
- plugin: es
opt: target=ts
out: gen
out: src/gen
- plugin: connect-es
opt: target=ts
out: gen

out: src/gen
Loading

0 comments on commit d1235da

Please sign in to comment.