diff --git a/.github/actions/yarn-install/action.yml b/.github/actions/yarn-install/action.yml index d42f20c80b..b3319dc92e 100644 --- a/.github/actions/yarn-install/action.yml +++ b/.github/actions/yarn-install/action.yml @@ -8,16 +8,32 @@ inputs: type: string required: false default: 'false' + no-yarn-lock: + type: string + required: false + default: 'false' runs: using: "composite" steps: - uses: actions/setup-node@v4 + name: Setup Node With Yarn Cache + if: ${{ inputs.no-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.no-yarn-lock == 'true' }} + with: + node-version: ${{ inputs.node-version }} check-latest: true + - name: Remove yarn.lock + if: ${{ inputs.no-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.no-yarn-lock != 'true' && '--frozen-lockfile' || '' }} --non-interactive --ignore-scripts ${{ inputs.ignore-engines == 'true' && '--ignore-engines' || ''}} shell: bash diff --git a/.github/workflows/nightly-node-compatibility-validation.yml b/.github/workflows/nightly-nodejs-validation.yml similarity index 80% rename from .github/workflows/nightly-node-compatibility-validation.yml rename to .github/workflows/nightly-nodejs-validation.yml index 6a4d7341b1..e92fd235a2 100644 --- a/.github/workflows/nightly-node-compatibility-validation.yml +++ b/.github/workflows/nightly-nodejs-validation.yml @@ -6,11 +6,12 @@ # 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) + # Daily at at 5:00 UTC - cron: '0 5 * * *' + push: jobs: test: @@ -25,9 +26,9 @@ jobs: 'lts/*', # latest lts 'current' # newest ] + no-yarn-lock: ['false', 'true'] include: - - runs-on: ubuntu-latest - node-version: '18.0' + - node-version: '18.0' # @typescript-eslint/eslint-plugin requires node ^18.18 # but we allow yarn install to run regardless to test the package ignore-engines: 'true' @@ -35,6 +36,7 @@ jobs: with: node-version: ${{ matrix.node-version }} runs-on: ${{ matrix.runs-on }} + no-yarn-lock: ${{ matrix.no-yarn-lock }} comment-on-pr-for-failures: runs-on: ubuntu-latest @@ -49,5 +51,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 05da26590a..acf04dd63a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,18 +5,23 @@ 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' + no-yarn-lock: + type: string + required: false + default: 'false' + jobs: test: - name: "Tests [Node.js ${{ inputs.node-version }}, ${{ inputs.runs-on }}]" + name: "Tests [Node.js ${{ inputs.node-version }}, ${{ inputs.runs-on }}, ${{ inputs.no-yarn-lock && 'Ignoring yarn.lock' || 'Using Yarn.lock'}}]" runs-on: ${{ inputs.runs-on }} steps: - uses: actions/checkout@v4 @@ -24,5 +29,6 @@ jobs: with: node-version: ${{ inputs.node-version }} ignore-engines: ${{ inputs.ignore-engines }} + no-yarn-lock: ${{ inputs.no-yarn-lock }} - name: Run Jest Tests run: yarn jest --ci --maxWorkers 4 --reporters=default --reporters=jest-junit --rootdir='./'