From 1e816cd0f76ae949109fb86443156bfd2ebc06f6 Mon Sep 17 00:00:00 2001 From: Vitali Zaidman Date: Fri, 9 Aug 2024 10:21:47 +0100 Subject: [PATCH] add nightly-latest-packages-validation --- .github/actions/yarn-install/action.yml | 11 +++++- .../nightly-latest-packages-validation.yml | 36 +++++++++++++++++++ ...tion.yml => nightly-nodejs-validation.yml} | 5 ++- .github/workflows/test.yml | 5 +++ package.json | 2 +- 5 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/nightly-latest-packages-validation.yml rename .github/workflows/{nightly-node-compatibility-validation.yml => nightly-nodejs-validation.yml} (85%) diff --git a/.github/actions/yarn-install/action.yml b/.github/actions/yarn-install/action.yml index 059f7650f..71cff4b28 100644 --- a/.github/actions/yarn-install/action.yml +++ b/.github/actions/yarn-install/action.yml @@ -4,6 +4,10 @@ inputs: type: string required: false default: '20.x' + recreate-yarn-lock: + type: boolean + required: false + default: false runs: using: "composite" @@ -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 diff --git a/.github/workflows/nightly-latest-packages-validation.yml b/.github/workflows/nightly-latest-packages-validation.yml new file mode 100644 index 000000000..0395b3b3c --- /dev/null +++ b/.github/workflows/nightly-latest-packages-validation.yml @@ -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 }})!', + }); diff --git a/.github/workflows/nightly-node-compatibility-validation.yml b/.github/workflows/nightly-nodejs-validation.yml similarity index 85% rename from .github/workflows/nightly-node-compatibility-validation.yml rename to .github/workflows/nightly-nodejs-validation.yml index ce2ed07e4..cdea70e19 100644 --- a/.github/workflows/nightly-node-compatibility-validation.yml +++ b/.github/workflows/nightly-nodejs-validation.yml @@ -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: @@ -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 }})!', }); diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 12e643349..84c08f7ad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,10 @@ on: type: string required: false default: '20.x' + latest-packages: + type: boolean + required: false + default: false jobs: test: @@ -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='./' diff --git a/package.json b/package.json index e55f6b68c..43cfe0973 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,6 @@ "license": "MIT", "dependencies": {}, "engines": { - "node": ">=18" + "node": ">=18.18" } }