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 cfba789
Show file tree
Hide file tree
Showing 24 changed files with 83 additions and 27 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
2 changes: 1 addition & 1 deletion .github/workflows/build-test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
fail-fast: false
matrix:
runs-on: ['ubuntu-latest']
node-version: ['18.0', '18.x', '20.x']
node-version: ['18.18', '18.x', '20.x']
uses: ./.github/workflows/test.yml
with:
node-version: ${{ matrix.node-version }}
Expand Down
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 All @@ -21,7 +20,7 @@ jobs:
matrix:
runs-on: ['ubuntu-latest']
node-version: [ # https://github.com/nodejs/release#release-schedule
'18.0', # minimum supported
'18.18', # minimum supported
'lts/-1', # pre-latest lts
'lts/*', # latest lts
'current' # newest
Expand All @@ -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='./'
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"
}
}
2 changes: 1 addition & 1 deletion packages/buck-worker-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"cleanup-release": "test ! -e build && mv src build && mv src.real src"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-babel-register/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-babel-transformer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"nullthrows": "^1.1.1"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-cache-key/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"metro-memory-fs": "0.80.10"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
},
"dependencies": {
"flow-enums-runtime": "^0.0.6"
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-file-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"fsevents": "^2.3.2"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-memory-fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
},
"dependencies": {
"flow-enums-runtime": "^0.0.6"
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-minify-terser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"terser": "^5.15.0"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
},
"devDependencies": {
"metro": "0.80.10"
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-source-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"terser": "^5.15.0"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-symbolicate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"vlq": "^1.0.0"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-transform-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"metro": "0.80.10"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro-transform-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"metro-memory-fs": "0.80.10"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/metro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@
},
"license": "MIT",
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}
2 changes: 1 addition & 1 deletion packages/ob1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"flow-enums-runtime": "^0.0.6"
},
"engines": {
"node": ">=18"
"node": ">=18.18"
}
}

0 comments on commit cfba789

Please sign in to comment.