Skip to content

Update @actions/core to v3#70

Merged
AnHeuermann merged 1 commit intoOpenModelica:mainfrom
JKRT:update-actions-core-v3
Feb 3, 2026
Merged

Update @actions/core to v3#70
AnHeuermann merged 1 commit intoOpenModelica:mainfrom
JKRT:update-actions-core-v3

Conversation

@JKRT
Copy link
Copy Markdown
Member

@JKRT JKRT commented Feb 2, 2026

This updates @actions/core from v2 to v3, which is an ESM-only package.

Changes required for ESM compatibility:

  • Add jest.config.mjs with ts-jest ESM preset
  • Update test script to use --experimental-vm-modules
  • Update test files to use jest.unstable_mockModule() for ESM mocking
  • Import jest from @jest/globals instead of using globals
  • Use dynamic imports after setting up mocks
  • Fix __dirname usage in src/collect.ts using import.meta.url

Fixes #66

@AnHeuermann Let's see how this goes

@JKRT JKRT requested a review from AnHeuermann as a code owner February 2, 2026 10:14
@JKRT JKRT force-pushed the update-actions-core-v3 branch from 18d2829 to cad9952 Compare February 2, 2026 10:36
@JKRT JKRT self-assigned this Feb 2, 2026
Copy link
Copy Markdown
Member

@AnHeuermann AnHeuermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the mocks into __fixtures__/core.ts if possible.

Comment thread __tests__/main.test.ts Outdated
Comment on lines +25 to +37
const debugMock = jest
.fn<(message: string) => void>()
.mockImplementation(msg => console.log(`::debug::${msg}`))
const infoMock = jest
.fn<(message: string) => void>()
.mockImplementation(msg => console.log(`::info::${msg}`))
const errorMock = jest
.fn<(message: string | Error) => void>()
.mockImplementation(msg => console.log(`::error::${msg}`))
const getInputMock =
jest.fn<(name: string, options?: { required?: boolean }) => string>()
const setFailedMock = jest.fn<(message: string | Error) => void>()
const setOutputMock = jest.fn<(name: string, value: unknown) => void>()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JKRT can you move all the mocking definitions to fixture/core.ts like in https://github.com/actions/typescript-action/blob/main/__fixtures__/core.ts?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JKRT JKRT force-pushed the update-actions-core-v3 branch 2 times, most recently from 7484054 to 24e2194 Compare February 2, 2026 15:55
@JKRT
Copy link
Copy Markdown
Member Author

JKRT commented Feb 2, 2026

@AnHeuermann

Copy link
Copy Markdown
Member

@AnHeuermann AnHeuermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to fix the pip upgrade error on Windows in another PR an then this is good to go.

This updates @actions/core from v2 to v3, which is an ESM-only package.

Changes required for ESM compatibility:
- Add jest.config.mjs with ts-jest ESM preset
- Update test script to use --experimental-vm-modules
- Update test files to use jest.unstable_mockModule() for ESM mocking
- Import jest from @jest/globals instead of using globals
- Use dynamic imports after setting up mocks
- Fix __dirname usage in src/collect.ts using import.meta.url

Fixes OpenModelica#66

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@AnHeuermann AnHeuermann force-pushed the update-actions-core-v3 branch from 24e2194 to 0926b75 Compare February 3, 2026 09:58
@AnHeuermann AnHeuermann merged commit d0602d9 into OpenModelica:main Feb 3, 2026
13 of 14 checks passed
@JKRT JKRT deleted the update-actions-core-v3 branch February 4, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update @actions/core to v3

2 participants