-
Notifications
You must be signed in to change notification settings - Fork 561
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
Refactor PR workflow into separate test jobs #6746
Conversation
- name: Get NPM cache directory | ||
id: npm-cache-dir | ||
shell: bash | ||
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed as this is already handled by actions/setup-node@v4
.
@@ -131,23 +138,9 @@ jobs: | |||
- name: Setup node version | |||
uses: actions/setup-node@v4 | |||
with: | |||
node-version: 20.11.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was for a workaround in prebuild
which is not released and this PR includes an upgrade to get the fix: prebuild/prebuild#325
# On CI, file timestamps change with every run so instead rely on file content hashing | ||
# https://reactnative.dev/docs/build-speed#using-this-approach-on-a-ci | ||
- name: Configure ccache | ||
run: ccache --set-config="compiler_check=content" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already handled by hendrikmuhs/ccache-action@v1
.
|
||
- name: Create Mocha Remote Context | ||
id: mocha-env | ||
run: echo "context=syncLogLevel=warn,longTimeoutMs=${{ env.LONG_TIMEOUT }},baseUrl=${{ steps.baas.outputs.baas-url }}" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little annoying that this is now duplicated in the workspace code 🤔
# Because the Xcode project injects its own CCACHE_CONFIGPATH, | ||
# the configuration set by the ccache action doesn't propagate. | ||
- name: Expose Ccache config to Xcode | ||
run: | | ||
echo "CCACHE_DIR=`ccache --get-config cache_dir`" >> $GITHUB_ENV | ||
echo "CCACHE_MAXSIZE=`ccache --get-config max_size`" >> $GITHUB_ENV | ||
echo "CCACHE_COMPILERCHECK=`ccache --get-config compiler_check`" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the fix for the main issue.
- The React Native ccache scripts use
CCACHE_CONFIGPATH
: https://github.com/facebook/react-native/blob/f7fe68861a52a0428698a9352d39a6e39afefe42/packages/react-native/scripts/xcode/ccache-clang.sh#L12 - This makes ccache disregard the system-wide configuration, specifically the
cache_dir
which is unexpected to thehendrikmuhs/ccache-action@v1
action. - We'll instead read the relevant configs set by the action and export these via environment variables for the React Native ccache scripts to pick up during compilation via Xcode.
@@ -109,7 +109,7 @@ | |||
} | |||
}, | |||
"pod-install:ci": { | |||
"command": "pod-install", | |||
"command": "cd ios && pod install --verbose", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This helped me debug the progress and just gives a bit more output.
@@ -336,7 +336,7 @@ | |||
"cross-env": "^7.0.3", | |||
"glob": "^10.3.12", | |||
"mocha": "^10.1.0", | |||
"prebuild": "^12.1.0", | |||
"prebuild": "^13.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the note above on upgrading "node".
# Hermes doesn't work with Cocoapods 1.15.0 | ||
# https://forums.developer.apple.com/forums/thread/745518 | ||
- name: Install older Cocoapods version | ||
if: ${{ matrix.variant.os == 'ios' }} | ||
uses: maxim-lobanov/setup-cocoapods@v1 | ||
with: | ||
version: 1.14.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got fixed in 1.15.2 which is now installed on the runner and there's no need for the workaround anymore.
954c576
to
5f935a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Quicker CI is always great 🚀
.github/workflows/pr-realm-js.yml
Outdated
node-electron-tests: | ||
name: Test ${{ matrix.environment }} on ${{ matrix.runner }} (${{matrix.script_name}}) | ||
needs: | ||
- generate-jsi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is JSI needed for node? Shouldn't it be node-prebuild
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch - generate-jsi
is not needed for the Node / Electron tests 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be very helpful!
What, How & Why?
My work on #6742 turned into a refactor of the PR workflow separating the test job into three, each depending only on the jobs producing the artifacts they need. Taking us one step closer towards #6530.