-
Notifications
You must be signed in to change notification settings - Fork 640
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
Convert the CircleCI workflow to a GitHub Actions workflow #1221
Open
jk0
wants to merge
1
commit into
facebook:main
Choose a base branch
from
robandpdx-org:convert-facebook-metro-to-actions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,87 @@ | ||||||
name: facebook/metro/build-and-deploy | ||||||
on: | ||||||
push: | ||||||
branches: | ||||||
- main | ||||||
jobs: | ||||||
run-js-checks: | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/[email protected] | ||||||
- uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: 18.12 | ||||||
cache: yarn | ||||||
- name: Install Dependencies | ||||||
run: npm install --force flow-bin | ||||||
- run: yarn typecheck | ||||||
- run: yarn typecheck-ts | ||||||
- run: yarn lint | ||||||
- run: yarn test-smoke | ||||||
test-with-coverage: | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/[email protected] | ||||||
- uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: 18.12 | ||||||
cache: yarn | ||||||
- name: Install Dependencies | ||||||
run: npm install --force @babel/core | ||||||
- run: yarn test-coverage | ||||||
- name: Download Codecov Uploader | ||||||
run: "./.circleci/scripts/install_codecov.sh" | ||||||
- name: Upload coverage results | ||||||
run: "./codecov -t ${{ secrets.CODECOV_TOKEN }} -f ./coverage/coverage-final.json" | ||||||
test: | ||||||
runs-on: ubuntu-latest | ||||||
strategy: | ||||||
matrix: | ||||||
node-version: [ 18.12, 20.2 ] | ||||||
steps: | ||||||
- uses: actions/[email protected] | ||||||
- uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: ${{ matrix.node-version }} | ||||||
- name: Install Dependencies | ||||||
run: npm install --force --save-dev jest | ||||||
- name: Run Jest tests | ||||||
run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit | ||||||
test-windows: | ||||||
if: startsWith(github.ref, 'refs/heads/windows/') | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/[email protected] | ||||||
- uses: actions/[email protected] | ||||||
with: | ||||||
path: reports/ | ||||||
- uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: 18.12 | ||||||
cache: yarn | ||||||
- name: Install Dependencies | ||||||
run: npm install --force --save-dev jest | ||||||
- name: Run Jest tests | ||||||
run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit | ||||||
publish-to-npm: | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/[email protected] | ||||||
- uses: actions/setup-node@v4 | ||||||
with: | ||||||
node-version: 18.12 | ||||||
cache: yarn | ||||||
- name: Check Tag Format | ||||||
id: check_tag | ||||||
run: | | ||||||
if [[ $GITHUB_REF =~ ^refs/tags/v\d+(\.\d+){2}(-.*)?$ ]]; then | ||||||
echo "valid=true" >> $GITHUB_OUTPUT | ||||||
else | ||||||
echo "valid=false" >> $GITHUB_OUTPUT | ||||||
fi | ||||||
shell: bash | ||||||
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc | ||||||
- name: Infer dist-tag and run npm run publish | ||||||
if: steps.check_tag.outputs.valid == 'true' | ||||||
run: "./.circleci/scripts/publish.sh" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This script relies on metro/.circleci/scripts/publish.sh Lines 7 to 8 in 59a0e36
|
||||||
- run: rm ~/.npmrc |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We need to be using Yarn to install dependencies so that
yarn.lock
is respected - that's the reason for the test failure you're seeing.I'm not sure what the significance of
@babel/core
is here (and similarly--save-dev jest
in jobs below)?yarn --frozen-lockfile --non-interactive --ignore-scripts
is the corresponding line in our CircleCIconfig.yml
, and we use that for all jobs:metro/.circleci/config.yml
Line 35 in 59a0e36