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 1e816cd
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 5 deletions.
11 changes: 10 additions & 1 deletion .github/actions/yarn-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ inputs:
type: string
required: false
default: '20.x'
recreate-yarn-lock:
type: boolean
required: false
default: false

runs:
using: "composite"
Expand All @@ -14,6 +18,11 @@ runs:
cache: yarn
cache-dependency-path: yarn.lock
check-latest: true
- name: Remove yarn.lock
if: ${{ inputs.recreate-yarn-lock }}
run: rm yarn.lock
shell: bash
- name: Install Dependencies
run: yarn install --frozen-lockfile --non-interactive --ignore-scripts
if: ${{ inputs.recreate-yarn-lock }}
run: yarn install ${{ inputs.recreate-yarn-lock == 'false' && '--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 }})!',
});
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
type: string
required: false
default: '20.x'
latest-packages:
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 }}
latest-packages: ${{ inputs.latest-packages }}
- name: Run Jest Tests
run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit --rootdir='./'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@
"license": "MIT",
"dependencies": {},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}

0 comments on commit 1e816cd

Please sign in to comment.