Skip to content

Commit

Permalink
add nightly-latest-packages-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
vzaidman committed Sep 9, 2024
1 parent f1d5cb3 commit 184d798
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
18 changes: 17 additions & 1 deletion .github/actions/yarn-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,32 @@ inputs:
type: string
required: false
default: 'false'
no-yarn-lock:
type: string
required: false
default: 'false'

runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
name: Setup Node With Yarn Cache
if: ${{ inputs.no-yarn-lock != 'true' }}
with:
node-version: ${{ inputs.node-version }}
check-latest: true
cache: yarn
cache-dependency-path: yarn.lock
- uses: actions/setup-node@v4
name: Setup Node With No Yarn Cache
if: ${{ inputs.no-yarn-lock == 'true' }}
with:
node-version: ${{ inputs.node-version }}
check-latest: true
- name: Remove yarn.lock
if: ${{ inputs.no-yarn-lock == 'true' }}
run: rm yarn.lock
shell: bash
- name: Install Dependencies
run: yarn install --frozen-lockfile --non-interactive --ignore-scripts ${{ inputs.ignore-engines == 'true' && '--ignore-engines' || ''}}
run: yarn install ${{ inputs.no-yarn-lock != 'true' && '--frozen-lockfile' || '' }} --non-interactive --ignore-scripts ${{ inputs.ignore-engines == 'true' && '--ignore-engines' || ''}}
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,16 +26,16 @@ jobs:
'lts/*', # latest lts
'current' # newest
]
include:
- runs-on: ubuntu-latest
node-version: '18.0'
# @typescript-eslint/eslint-plugin requires node ^18.18
# but we allow yarn install to run regardless to test the package
ignore-engines: 'true'
no-yarn-lock: ['false', 'true']
name: "Tests [Node.js ${{ matrix.node-version }}, ${{ matrix.runs-on }}, ${{ matrix.no-yarn-lock && 'Ignoring yarn.lock' || 'Using yarn.lock'}}]"
uses: ./.github/workflows/test.yml
with:
node-version: ${{ matrix.node-version }}
runs-on: ${{ matrix.runs-on }}
no-yarn-lock: ${{ matrix.no-yarn-lock }}
# @typescript-eslint/eslint-plugin requires node ^18.18
# but we allow yarn install to run regardless to test the package
ignore-engines: ${{ matrix.node-version == '18.0' && 'true' || 'false'}}

comment-on-pr-for-failures:
runs-on: ubuntu-latest
Expand All @@ -49,5 +50,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,24 +5,30 @@ 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'
ignore-engines:
type: string
required: false
default: 'false'
no-yarn-lock:
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 }}, ${{ inputs.no-yarn-lock && 'Ignoring yarn.lock' || 'Using yarn.lock'}}]"
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/yarn-install
with:
node-version: ${{ inputs.node-version }}
ignore-engines: ${{ inputs.ignore-engines }}
no-yarn-lock: ${{ inputs.no-yarn-lock }}
- name: Run Jest Tests
run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit --rootdir='./'

0 comments on commit 184d798

Please sign in to comment.