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 Aug 9, 2024
1 parent ec3f4fb commit bc7e11a
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 6 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 @@ -4,16 +4,32 @@ inputs:
type: string
required: false
default: '20.x'
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
run: yarn install ${{ inputs.recreate-yarn-lock != 'true' && '--frozen-lockfile' || '' }} --non-interactive --ignore-scripts
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,12 +6,11 @@
# 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)
- cron: '0 5 * * *'
push:

jobs:
test:
Expand Down Expand Up @@ -44,5 +43,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 }})!',
});
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ 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'
recreate-yarn-lock:
type: boolean
required: false
default: false

jobs:
test:
Expand All @@ -20,5 +24,6 @@ jobs:
- uses: ./.github/actions/yarn-install
with:
node-version: ${{ inputs.node-version }}
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 bc7e11a

Please sign in to comment.