mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
dev
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
name: "Download build artifacts"
|
name: "Download build artifacts"
|
||||||
description: "Download build artifacts"
|
description: "Download build artifacts"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
packages:
|
||||||
|
description: 'packages to cache'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: 'dist nxcache'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
@@ -8,7 +16,7 @@ runs:
|
|||||||
env:
|
env:
|
||||||
REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}"
|
REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}"
|
||||||
run: |
|
run: |
|
||||||
packages=( dist nxcache node_modules )
|
packages=( $(echo ${{ inputs.packages }}) )
|
||||||
for i in "${packages[@]}"; do
|
for i in "${packages[@]}"; do
|
||||||
time aws s3 cp --no-progress s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz $i.tar.gz
|
time aws s3 cp --no-progress s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz $i.tar.gz
|
||||||
du -h $i.tar.gz
|
du -h $i.tar.gz
|
||||||
@@ -20,8 +28,10 @@ runs:
|
|||||||
pwd
|
pwd
|
||||||
ls -lha
|
ls -lha
|
||||||
echo "====DIST===="
|
echo "====DIST===="
|
||||||
find dist -maxdepth 1 -type d
|
find dist -maxdepth 1 -type d || true
|
||||||
echo "====NXCACHE===="
|
echo "====NXCACHE===="
|
||||||
find nxcache -maxdepth 1 -type d
|
find nxcache -maxdepth 1 -type d || true
|
||||||
echo "====ADF===="
|
echo "====ADF===="
|
||||||
find node_modules/@alfresco/ -maxdepth 1 -type d
|
find node_modules/@alfresco/ -maxdepth 1 -type d || true
|
||||||
|
echo "====NX===="
|
||||||
|
find node_modules/nx/ -maxdepth 1 -type d || true
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
name: 'Setup'
|
name: 'Setup'
|
||||||
description: 'Initialize cache, env var load'
|
description: 'Initialize cache, env var load'
|
||||||
inputs:
|
inputs:
|
||||||
enable-cache:
|
cache-key-suffix:
|
||||||
|
description: 'suffix for cache key'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ''
|
||||||
|
enable-global-nx-cache:
|
||||||
description: 'enable caching'
|
description: 'enable caching'
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: 'true'
|
default: 'true'
|
||||||
enable-node-modules-cache:
|
enable-global-node-modules-cache:
|
||||||
description: 'enable caching for node modules'
|
description: 'enable caching for node modules'
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
@@ -19,6 +24,7 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: install NPM
|
- name: install NPM
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
@@ -28,44 +34,31 @@ 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
|
- name: NX cache
|
||||||
id: node-cache
|
id: nx-cache
|
||||||
if: ${{ inputs.enable-cache == 'true' }}
|
if: ${{ inputs.enable-global-nx-cache == 'true' }}
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
env:
|
env:
|
||||||
cache-name: node-cache
|
cache-name: nx-cache
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.npm
|
|
||||||
nxcache
|
nxcache
|
||||||
dist
|
key: nxcache-${{ github.ref_name }}-${{ inputs.cache-key-suffix }}-${{ hashFiles('**/package-lock.json') }}
|
||||||
key: .npm-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}-${{ steps.tag-sha.outputs.tag_sha }}
|
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
node-${{ runner.os }}-build-${{ env.cache-name }}-
|
nxcache-${{ github.ref_name }}-build-${{ inputs.cache-key-suffix }}
|
||||||
node-${{ runner.os }}-build-
|
nxcache-${{ github.ref_name }}-
|
||||||
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-global-node-modules-cache == 'true' }}
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
env:
|
env:
|
||||||
cache-name: node-modules-cache
|
cache-name: node-modules-cache
|
||||||
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: ${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
node_modules-${{ runner.os }}-build-${{ env.cache-name }}-
|
${{ env.cache-name }}-
|
||||||
node_modules-${{ runner.os }}-build-
|
|
||||||
node_modules-${{ runner.os }}-
|
|
||||||
- name: pip cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
if: ${{ inputs.enable-cache == 'true' }}
|
|
||||||
with:
|
|
||||||
path: ~/.cache/pip
|
|
||||||
key: ${{ runner.os }}-pip-
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}
|
|
||||||
# ENV LOAD
|
# ENV LOAD
|
||||||
- name: load .travis.yml env.global variables
|
- name: load .travis.yml env.global variables
|
||||||
uses: Alfresco/alfresco-build-tools/.github/actions/travis-env-load@v1.17.0
|
uses: Alfresco/alfresco-build-tools/.github/actions/travis-env-load@v1.17.0
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
name: "Upload build artifacts"
|
name: "Upload build artifacts"
|
||||||
description: "Upload build artifacts"
|
description: "Upload build artifacts"
|
||||||
|
inputs:
|
||||||
|
packages:
|
||||||
|
description: 'packages to cache'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: 'dist nxcache'
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
@@ -9,7 +14,7 @@ runs:
|
|||||||
env:
|
env:
|
||||||
REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}"
|
REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}"
|
||||||
run: |
|
run: |
|
||||||
packages=( dist nxcache node_modules )
|
packages=( $(echo ${{ inputs.packages }}) )
|
||||||
for i in "${packages[@]}"; do
|
for i in "${packages[@]}"; do
|
||||||
time tar czf $i.tar.gz $i
|
time tar czf $i.tar.gz $i
|
||||||
du -h $i.tar.gz
|
du -h $i.tar.gz
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
default: true
|
||||||
|
skip-pr-approve:
|
||||||
|
description: 'skip pr approve check'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
branches:
|
branches:
|
||||||
@@ -83,7 +88,7 @@ jobs:
|
|||||||
- name: Show the number
|
- name: Show the number
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
DEVEL_FLAG: false #put it to true if you need to develop the pipeline on your own branch. before the final merge put it to false
|
DEVEL_FLAG: ${{ inputs.skip-pr-approve }} #put it to true if you need to develop the pipeline on your own branch. before the final merge put it to false
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ github.event_name != 'schedule' }}
|
if: ${{ github.event_name != 'schedule' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -113,13 +118,18 @@ 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
|
||||||
- name: install
|
id: setup
|
||||||
run: |
|
with:
|
||||||
npm ci
|
enable-global-nx-cache: false
|
||||||
nx run cli:bundle
|
enable-global-node-modules-cache: true
|
||||||
nx run testing:bundle
|
- name: run ci
|
||||||
- run: nx print-affected $NX_CALCULATION_FLAGS
|
if: steps.setup.outputs.cache-hit != 'true'
|
||||||
|
run: npm ci
|
||||||
|
- run: nx run cli:bundle
|
||||||
|
- run: nx run testing:bundle
|
||||||
- uses: ./.github/actions/upload-cache-and-artifacts
|
- uses: ./.github/actions/upload-cache-and-artifacts
|
||||||
|
with:
|
||||||
|
packages: 'dist node_modules'
|
||||||
|
|
||||||
unit-tests:
|
unit-tests:
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
@@ -145,7 +155,13 @@ 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
|
with:
|
||||||
|
enable-global-nx-cache: true
|
||||||
|
enable-global-node-modules-cache: false
|
||||||
|
cache-key-suffix: unit-tests-${{ matrix.unit-tests.name }}
|
||||||
|
# - uses: ./.github/actions/download-cache-and-artifacts
|
||||||
|
# with:
|
||||||
|
# packages: 'node_modules'
|
||||||
- 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 }}
|
||||||
@@ -162,7 +178,13 @@ 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
|
||||||
|
with:
|
||||||
|
enable-global-nx-cache: true
|
||||||
|
enable-global-node-modules-cache: false
|
||||||
|
cache-key-suffix: lint
|
||||||
- uses: ./.github/actions/download-cache-and-artifacts
|
- uses: ./.github/actions/download-cache-and-artifacts
|
||||||
|
with:
|
||||||
|
packages: 'node_modules'
|
||||||
- run: nx affected --target=lint $NX_CALCULATION_FLAGS
|
- run: nx affected --target=lint $NX_CALCULATION_FLAGS
|
||||||
|
|
||||||
build-libs:
|
build-libs:
|
||||||
@@ -177,12 +199,19 @@ 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
|
with:
|
||||||
|
enable-global-nx-cache: false
|
||||||
|
enable-global-node-modules-cache: true
|
||||||
|
cache-key-suffix: build-libs
|
||||||
|
# - uses: ./.github/actions/download-cache-and-artifacts
|
||||||
|
# with:
|
||||||
|
# packages: 'node_modules'
|
||||||
- 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: rm -f /home/runner/work/alfresco-ng2-components/alfresco-ng2-components/node_modules/.ngcc_lock_file
|
|
||||||
- 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-cache-and-artifacts
|
||||||
|
with:
|
||||||
|
packages: 'dist'
|
||||||
|
|
||||||
e2e-storybook:
|
e2e-storybook:
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
@@ -195,13 +224,17 @@ 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
|
||||||
|
with:
|
||||||
|
enable-global-nx-cache: false
|
||||||
|
enable-global-node-modules-cache: false
|
||||||
- uses: ./.github/actions/download-cache-and-artifacts
|
- uses: ./.github/actions/download-cache-and-artifacts
|
||||||
|
with:
|
||||||
|
packages: 'dist nxcache node_modules'
|
||||||
- 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
|
|
||||||
|
|
||||||
e2e:
|
e2e:
|
||||||
timeout-minutes: 90
|
timeout-minutes: 90
|
||||||
@@ -332,9 +365,11 @@ jobs:
|
|||||||
fetch-depth: 0 # Fetch all history for all
|
fetch-depth: 0 # Fetch all history for all
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
with:
|
with:
|
||||||
enable-cache: "true"
|
enable-global-nx-cache: true
|
||||||
enable-node-modules-cache: "true"
|
enable-global-node-modules-cache: true
|
||||||
- uses: ./.github/actions/download-cache-and-artifacts
|
- uses: ./.github/actions/download-cache-and-artifacts
|
||||||
|
with:
|
||||||
|
packages: 'dist nxcache node_modules'
|
||||||
- name: setup chrome
|
- name: setup chrome
|
||||||
uses: ./.github/actions/setup-chrome
|
uses: ./.github/actions/setup-chrome
|
||||||
- name: e2e
|
- name: e2e
|
||||||
|
|||||||
@@ -80,14 +80,16 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
with:
|
with:
|
||||||
enable-cache: false
|
enable-global-nx-cache: false
|
||||||
enable-node-modules-cache: false
|
enable-global-node-modules-cache: false
|
||||||
- name: install
|
- name: install
|
||||||
run: |
|
run: |
|
||||||
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-cache-and-artifacts
|
||||||
|
with:
|
||||||
|
packages: 'dist nxcache node_modules'
|
||||||
|
|
||||||
release-demoshell:
|
release-demoshell:
|
||||||
needs: [setup]
|
needs: [setup]
|
||||||
@@ -106,9 +108,11 @@ jobs:
|
|||||||
dry-run-flag: ${{ inputs.dry-run-release }}
|
dry-run-flag: ${{ inputs.dry-run-release }}
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
with:
|
with:
|
||||||
enable-cache: false
|
enable-global-nx-cache: false
|
||||||
enable-node-modules-cache: false
|
enable-global-node-modules-cache: false
|
||||||
- uses: ./.github/actions/download-cache-and-artifacts
|
- uses: ./.github/actions/download-cache-and-artifacts
|
||||||
|
with:
|
||||||
|
packages: 'dist nxcache node_modules'
|
||||||
- name: release Demoshell docker
|
- name: release Demoshell docker
|
||||||
run: |
|
run: |
|
||||||
nx build demoshell --configuration production
|
nx build demoshell --configuration production
|
||||||
@@ -132,10 +136,12 @@ jobs:
|
|||||||
dry-run-flag: ${{ inputs.dry-run-release }}
|
dry-run-flag: ${{ inputs.dry-run-release }}
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
with:
|
with:
|
||||||
enable-cache: false
|
enable-global-nx-cache: false
|
||||||
enable-node-modules-cache: false
|
enable-global-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-cache-and-artifacts
|
||||||
|
with:
|
||||||
|
packages: 'dist nxcache node_modules'
|
||||||
- name: release Storybook docker
|
- name: release Storybook docker
|
||||||
run: |
|
run: |
|
||||||
nx run stories:build-storybook --configuration ci
|
nx run stories:build-storybook --configuration ci
|
||||||
@@ -154,13 +160,15 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
with:
|
with:
|
||||||
enable-cache: false
|
enable-global-nx-cache: false
|
||||||
enable-node-modules-cache: false
|
enable-global-node-modules-cache: false
|
||||||
- id: set-dryrun
|
- id: set-dryrun
|
||||||
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-cache-and-artifacts
|
||||||
|
with:
|
||||||
|
packages: 'dist nxcache node_modules'
|
||||||
- name: build libraries
|
- name: build libraries
|
||||||
run: |
|
run: |
|
||||||
set -u;
|
set -u;
|
||||||
|
|||||||
Reference in New Issue
Block a user