Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: added a job for react-compiler checks 🧬 #45998

Merged
merged 24 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
466fa84
ci: added a job for react-compiler checks
kirillzyusko Jul 23, 2024
2220f95
fix: convert json output to single-line output
kirillzyusko Jul 23, 2024
a49676f
fix: redirect spinner output to stderr and ignore it
kirillzyusko Jul 23, 2024
629722b
fix: let's debug step by step and see what is wrong
kirillzyusko Jul 23, 2024
cf5c218
fix: single output from the core
kirillzyusko Jul 23, 2024
05c2411
fix: patch not found error
kirillzyusko Jul 23, 2024
6f9a675
fix: simplify branching switching
kirillzyusko Jul 23, 2024
b9cf9d9
fix: don't apply patch
kirillzyusko Jul 23, 2024
6b5ac7b
fix: backport changes to old code
kirillzyusko Jul 23, 2024
f29821f
fix: don't reinstall deps (temporarily), CI should be green now
kirillzyusko Jul 23, 2024
116a7d3
refactor: re-organize patches after rebase
kirillzyusko Jul 23, 2024
907b628
fix: setup node after branch switch
kirillzyusko Jul 23, 2024
d4b8483
fix: scan files in target first, and then switch to current branch
kirillzyusko Jul 23, 2024
fd1332d
fix: don't cast JSON to number :)
kirillzyusko Jul 23, 2024
849e306
feat: implement actual check
kirillzyusko Jul 23, 2024
b7feb93
check: add intentionally uncompilable code to see whether action work…
kirillzyusko Jul 23, 2024
df0850a
Revert "check: add intentionally uncompilable code to see whether act…
kirillzyusko Jul 23, 2024
f1201ad
fix: eslint, script logic
kirillzyusko Jul 24, 2024
884f90e
fix: recompile script
kirillzyusko Jul 24, 2024
dd1ee50
Revert "Revert "check: add intentionally uncompilable code to see whe…
kirillzyusko Jul 24, 2024
8eae14c
Revert "Revert "Revert "check: add intentionally uncompilable code to…
kirillzyusko Jul 24, 2024
26da3b5
feat: added documentation
kirillzyusko Jul 26, 2024
0991129
fix: modify text content
kirillzyusko Jul 26, 2024
0b78359
docs: change problems -> problem
kirillzyusko Jul 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/actions/javascript/checkReactCompiler/action.yml
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'
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;
Loading
Loading