AAE-12860-build errors on cron

skip nxcache exchange between jobs, changed node modules cache key
This commit is contained in:
Marco Carrozzo 2023-02-27 12:52:43 +01:00 committed by GitHub
parent 713320b01d
commit c890999c80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 37 deletions

View File

@ -10,7 +10,7 @@ inputs:
description: 'enable caching for node modules' description: 'enable caching for node modules'
required: false required: false
type: boolean type: boolean
default: 'true' default: 'true'
act: act:
description: 'enable act debug' description: 'enable act debug'
required: false required: false
@ -28,22 +28,6 @@ runs:
id: tag-sha id: tag-sha
uses: Alfresco/alfresco-build-tools/.github/actions/git-latest-tag@v1.29.0 uses: Alfresco/alfresco-build-tools/.github/actions/git-latest-tag@v1.29.0
# CACHE # CACHE
- name: Node cache
id: node-cache
if: ${{ inputs.enable-cache == 'true' }}
uses: actions/cache@v3
env:
cache-name: node-cache
with:
path: |
~/.npm
nxcache
dist
key: .npm-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}-${{ steps.tag-sha.outputs.tag_sha }}
restore-keys: |
node-${{ runner.os }}-build-${{ env.cache-name }}-
node-${{ runner.os }}-build-
node-${{ runner.os }}-
- name: Node Modules cache - name: Node Modules cache
id: node-modules-cache id: node-modules-cache
if: ${{ inputs.enable-node-modules-cache == 'true' }} if: ${{ inputs.enable-node-modules-cache == 'true' }}
@ -53,11 +37,11 @@ runs:
with: with:
path: | path: |
node_modules node_modules
key: .npm-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}-${{ steps.tag-sha.outputs.tag_sha }} key: .npm-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
node_modules-${{ runner.os }}-build-${{ env.cache-name }}- node_modules-${{ runner.os }}-build-${{ env.cache-name }}-
node_modules-${{ runner.os }}-build- node_modules-${{ runner.os }}-build-
node_modules-${{ runner.os }}- node_modules-${{ runner.os }}-
- name: pip cache - name: pip cache
uses: actions/cache@v3 uses: actions/cache@v3
if: ${{ inputs.enable-cache == 'true' }} if: ${{ inputs.enable-cache == 'true' }}

View File

@ -20,7 +20,7 @@ on:
- master - master
- develop-patch* - develop-patch*
- master-patch* - master-patch*
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
@ -150,7 +150,7 @@ jobs:
nx run cli:bundle nx run cli:bundle
nx run testing:bundle nx run testing:bundle
- run: nx print-affected $NX_CALCULATION_FLAGS - run: nx print-affected $NX_CALCULATION_FLAGS
- uses: ./.github/actions/upload-cache-and-artifacts - uses: ./.github/actions/upload-node-modules-and-artifacts
unit-tests: unit-tests:
timeout-minutes: 30 timeout-minutes: 30
@ -176,7 +176,7 @@ jobs:
with: with:
fetch-depth: 0 # Fetch all history for all tags and branches fetch-depth: 0 # Fetch all history for all tags and branches
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
- uses: ./.github/actions/download-cache-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- name: Run unit tests - name: Run unit tests
run: | run: |
/usr/bin/xvfb-run --auto-servernum nx affected:test $NX_CALCULATION_FLAGS --exclude=${{ matrix.unit-tests.exclude }} /usr/bin/xvfb-run --auto-servernum nx affected:test $NX_CALCULATION_FLAGS --exclude=${{ matrix.unit-tests.exclude }}
@ -193,7 +193,7 @@ jobs:
with: with:
fetch-depth: 0 # Fetch all history for all tags and branches fetch-depth: 0 # Fetch all history for all tags and branches
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
- uses: ./.github/actions/download-cache-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- run: nx affected --target=lint $NX_CALCULATION_FLAGS - run: nx affected --target=lint $NX_CALCULATION_FLAGS
build-libs: build-libs:
@ -208,11 +208,11 @@ jobs:
with: with:
fetch-depth: 0 # Fetch all history for all tags and branches fetch-depth: 0 # Fetch all history for all tags and branches
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
- uses: ./.github/actions/download-cache-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- run: nx affected:build $NX_CALCULATION_FLAGS --prod - run: nx affected:build $NX_CALCULATION_FLAGS --prod
- run: nx build demoshell --configuration production - run: nx build demoshell --configuration production
- run: nx affected --target=build-storybook $NX_CALCULATION_FLAGS --configuration ci - run: nx affected --target=build-storybook $NX_CALCULATION_FLAGS --configuration ci
- uses: ./.github/actions/upload-cache-and-artifacts - uses: ./.github/actions/upload-node-modules-and-artifacts
e2e-storybook: e2e-storybook:
timeout-minutes: 20 timeout-minutes: 20
@ -225,13 +225,13 @@ jobs:
with: with:
fetch-depth: 0 # Fetch all history for all fetch-depth: 0 # Fetch all history for all
- uses: ./.github/actions/setup - uses: ./.github/actions/setup
- uses: ./.github/actions/download-cache-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- name: Process Cloud Storybook Playwright - name: Process Cloud Storybook Playwright
run: | run: |
npx playwright install chromium npx playwright install chromium
sudo sysctl -w fs.inotify.max_user_watches=524288 sudo sysctl -w fs.inotify.max_user_watches=524288
npx nx affected --target=e2e-playwright $NX_CALCULATION_FLAGS || exit 1 npx nx affected --target=e2e-playwright $NX_CALCULATION_FLAGS || exit 1
- uses: ./.github/actions/upload-cache-and-artifacts - uses: ./.github/actions/upload-node-modules-and-artifacts
e2e: e2e:
timeout-minutes: 90 timeout-minutes: 90
@ -364,7 +364,7 @@ jobs:
with: with:
enable-cache: "true" enable-cache: "true"
enable-node-modules-cache: "true" enable-node-modules-cache: "true"
- uses: ./.github/actions/download-cache-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- name: setup chrome - name: setup chrome
uses: ./.github/actions/setup-chrome uses: ./.github/actions/setup-chrome
- name: e2e - name: e2e

View File

@ -68,7 +68,7 @@ env:
jobs: jobs:
setup: setup:
timeout-minutes: 20 timeout-minutes: 20
if: github.event.pull_request.merged if: github.event.pull_request.merged || ${{ inputs.dry-run-release }}
name: "Setup" name: "Setup"
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
@ -85,12 +85,12 @@ jobs:
npm ci npm ci
nx run cli:bundle nx run cli:bundle
nx run testing:bundle nx run testing:bundle
- uses: ./.github/actions/upload-cache-and-artifacts - uses: ./.github/actions/upload-node-modules-and-artifacts
release-demoshell: release-demoshell:
needs: [setup] needs: [setup]
timeout-minutes: 15 timeout-minutes: 15
if: github.event.pull_request.merged if: github.event.pull_request.merged || ${{ inputs.dry-run-release }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repository - name: Checkout repository
@ -106,7 +106,7 @@ jobs:
with: with:
enable-cache: false enable-cache: false
enable-node-modules-cache: false enable-node-modules-cache: false
- uses: ./.github/actions/download-cache-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- name: release Demoshell docker - name: release Demoshell docker
run: | run: |
nx build demoshell --configuration production nx build demoshell --configuration production
@ -116,7 +116,7 @@ jobs:
release-storybook: release-storybook:
needs: [setup] needs: [setup]
timeout-minutes: 15 timeout-minutes: 15
if: github.event.pull_request.merged if: github.event.pull_request.merged || ${{ inputs.dry-run-release }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repository - name: Checkout repository
@ -133,7 +133,7 @@ jobs:
enable-cache: false enable-cache: false
enable-node-modules-cache: false enable-node-modules-cache: false
act: ${{ inputs.dry-run-release }} act: ${{ inputs.dry-run-release }}
- uses: ./.github/actions/download-cache-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- name: release Storybook docker - name: release Storybook docker
run: | run: |
nx run stories:build-storybook --configuration ci nx run stories:build-storybook --configuration ci
@ -143,7 +143,7 @@ jobs:
release-npm: release-npm:
needs: [setup] needs: [setup]
timeout-minutes: 15 timeout-minutes: 15
if: github.event.pull_request.merged == true if: github.event.pull_request.merged == true || ${{ inputs.dry-run-release }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
permissions: permissions:
contents: read contents: read
@ -161,7 +161,7 @@ jobs:
uses: ./.github/actions/enable-dryrun uses: ./.github/actions/enable-dryrun
with: with:
dry-run-flag: ${{ inputs.dry-run-release }} dry-run-flag: ${{ inputs.dry-run-release }}
- uses: ./.github/actions/download-cache-and-artifacts - uses: ./.github/actions/download-node-modules-and-artifacts
- name: check PR number - name: check PR number
id: action id: action
uses: kamatama41/get-pr-number-action@v0 uses: kamatama41/get-pr-number-action@v0
@ -185,7 +185,7 @@ jobs:
npm-check-bundle: npm-check-bundle:
needs: [release-npm] needs: [release-npm]
timeout-minutes: 15 timeout-minutes: 15
if: github.event.pull_request.merged == true if: github.event.pull_request.merged == true || ${{ inputs.dry-run-release }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repository - name: Checkout repository