Skip to content

Commit

Permalink
expand nightlies to test after deleting yarn.lock (#1317)
Browse files Browse the repository at this point in the history
Summary:
expand the matrix of nightlies to test metro with latest packages supported in package.json by:
delete the `yarn.lock` file -> `yarn install` -> test

example run:
https://github.com/facebook/metro/actions/runs/10771317347

Pull Request resolved: #1317

Test Plan: https://github.com/facebook/metro/actions/runs/10771317347

Differential Revision: D62497468

Pulled By: vzaidman
  • Loading branch information
vzaidman committed Sep 12, 2024
1 parent 0fcd69a commit 226f9c6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
11 changes: 8 additions & 3 deletions .github/actions/yarn-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@ inputs:
type: string
required: false
default: '20.x'
no-lockfile:
type: string
required: false
default: 'false'

runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
name: Setup Node With Yarn Cache
with:
node-version: ${{ inputs.node-version }}
cache: yarn
cache-dependency-path: yarn.lock
check-latest: true
cache: ${{ inputs.no-lockfile == 'false' && 'yarn' || '' }}
cache-dependency-path: ${{ inputs.no-lockfile == 'false' && 'yarn.lock' || '' }}
- name: Install Dependencies
run: yarn install --frozen-lockfile --non-interactive --ignore-scripts
run: yarn install ${{ inputs.no-lockfile == 'false' && '--frozen-lockfile' || '--no-lockfile' }} --non-interactive --ignore-scripts
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
# to notify certain people when a Github workflow fails:
# https://github.com/orgs/community/discussions/18039

name: facebook/metro/nightly-node-compatibility-validation
name: facebook/metro/nightly-nodejs-validation
on:
schedule:
# Everyday at at 5:00 UTC (22:00 USA West Coast, 06:00 London)
# Daily at at 5:00 UTC
- cron: '0 5 * * *'
push:

jobs:
test:
Expand All @@ -25,10 +26,13 @@ jobs:
'lts/*', # latest lts
'current' # newest
]
no-lockfile: ['false', 'true']
name: "Tests [Node.js ${{ matrix.node-version }}, ${{ matrix.runs-on }}, ${{ matrix.no-lockfile == 'false' && 'Using yarn.lock' || 'Ignoring yarn.lock' }}]"
uses: ./.github/workflows/test.yml
with:
node-version: ${{ matrix.node-version }}
runs-on: ${{ matrix.runs-on }}
no-lockfile: ${{ matrix.no-lockfile }}

comment-on-pr-for-failures:
runs-on: ubuntu-latest
Expand All @@ -43,5 +47,5 @@ jobs:
issue_number: 1314,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'A nightly test failed in `${{ github.workflow }}` in [run ${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})!',
body: 'The nightly workflow `${{ github.workflow }}` failed in [run ${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})!',
});
12 changes: 9 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ on:
node-version:
type: string
required: false
default: 'ubuntu-latest'
default: '20.x'
runs-on:
type: string
required: false
default: '20.x'
default: 'ubuntu-latest'
no-lockfile:
type: string
required: false
default: 'false'

jobs:
test:
name: "Tests [Node.js ${{ inputs.node-version }}, ${{ inputs.runs-on }}]"
name: "Tests [Node.js ${{ inputs.node-version }}, ${{ inputs.runs-on }}, ${{ matrix.no-lockfile == 'false' && 'Using yarn.lock' || 'Ignoring yarn.lock' }}]"
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/yarn-install
with:
node-version: ${{ inputs.node-version }}
no-lockfile: ${{ inputs.no-lockfile }}
- name: Run Jest Tests
run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit --rootdir='./'

0 comments on commit 226f9c6

Please sign in to comment.