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 2abad7f
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 5 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'
recreate-yarn-lock:
type: boolean
required: false
default: false

runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
name: Setup Node With Yarn Cache
if: ${{ inputs.recreate-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.recreate-yarn-lock == 'true' }}
with:
node-version: ${{ inputs.node-version }}
check-latest: true
- name: Remove yarn.lock
if: ${{ inputs.recreate-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.recreate-yarn-lock != 'true' && '--frozen-lockfile' || '' }} --non-interactive --ignore-scripts ${{ inputs.ignore-engines == 'true' && '--ignore-engines' || ''}}
shell: bash
36 changes: 36 additions & 0 deletions .github/workflows/nightly-latest-packages-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# In order to be updated when nightlies fail, please subscribe for updates on PR:
# ---> https://github.com/facebook/metro/pull/1314 <---
# where comments will be published on fail.

# This is a bit of a workaround tackling the lack of an organic way
# to notify certain people when a Github workflow fails:
# https://github.com/orgs/community/discussions/18039

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

jobs:
test:
uses: ./.github/workflows/test.yml
with:
recreate-yarn-lock: true

comment-on-pr-for-failures:
runs-on: ubuntu-latest
needs: [test]
if: ${{ always() && needs.test.result == 'failure' }}
steps:
- uses: actions/github-script@v7
with:
script: |
// github.rest.issues.createComment({
// // see https://github.com/facebook/metro/pull/1314
// 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 }})!',
// });
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 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)
Expand Down Expand Up @@ -49,5 +49,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 }})!',
});
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ 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'
recreate-yarn-lock:
type: boolean
required: false
default: false

jobs:
test:
name: "Tests [Node.js ${{ inputs.node-version }}, ${{ inputs.runs-on }}]"
Expand All @@ -24,5 +29,6 @@ jobs:
with:
node-version: ${{ inputs.node-version }}
ignore-engines: ${{ inputs.ignore-engines }}
recreate-yarn-lock: ${{ inputs.recreate-yarn-lock }}
- name: Run Jest Tests
run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit --rootdir='./'

0 comments on commit 2abad7f

Please sign in to comment.