-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
151 changed files
with
4,620 additions
and
648 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: 'Check React compiler' | ||
description: 'Compares two lists of compiled files and fails a job if previously successfully compiled files are no longer compiled successfully' | ||
inputs: | ||
OLD_LIST: | ||
description: List of compiled files from the previous commit | ||
required: true | ||
NEW_LIST: | ||
description: List of compiled files from the current commit | ||
required: true | ||
runs: | ||
using: 'node20' | ||
main: 'index.js' |
37 changes: 37 additions & 0 deletions
37
.github/actions/javascript/checkReactCompiler/checkReactCompiler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import * as core from '@actions/core'; | ||
|
||
type ReactCompilerOutput = { | ||
success: string[]; | ||
failure: string[]; | ||
}; | ||
|
||
const run = function (): Promise<void> { | ||
const oldList = JSON.parse(core.getInput('OLD_LIST', {required: true})) as ReactCompilerOutput; | ||
const newList = JSON.parse(core.getInput('NEW_LIST', {required: true})) as ReactCompilerOutput; | ||
|
||
const errors: string[] = []; | ||
|
||
oldList.success.forEach((file) => { | ||
if (newList.success.includes(file) || !newList.failure.includes(file)) { | ||
return; | ||
} | ||
|
||
errors.push(file); | ||
}); | ||
|
||
if (errors.length > 0) { | ||
errors.forEach((error) => console.error(error)); | ||
throw new Error( | ||
'Some files could be compiled with react-compiler before successfully, but now they can not be compiled. Check https://github.com/Expensify/App/blob/main/contributingGuides/REACT_COMPILER.md documentation to see how you can fix this.', | ||
); | ||
} | ||
|
||
return Promise.resolve(); | ||
}; | ||
|
||
if (require.main === module) { | ||
run(); | ||
} | ||
|
||
export default run; |
Oops, something went wrong.