mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[AAE-11882] demoshell fix; pipeline bugfix (#8093)
* demoshell regr fix; s3 cache on s3; setup chrome; e2e headless fix
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
name: "Download build artifacts"
|
||||
description: "Download build artifacts"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
## NXCACHE
|
||||
- name: update NX cache folder
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: .
|
||||
name: nxcache
|
||||
## DIST
|
||||
- name: update Dist folder
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: .
|
||||
name: dist
|
||||
## ADF CLI
|
||||
- name: update Dist folder
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: .
|
||||
name: adf-cli
|
||||
## ADF TESTING
|
||||
- name: update Dist folder
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: .
|
||||
name: adf-testing
|
||||
- name: extract nxcache
|
||||
run: |
|
||||
tar xzf nxcache.tar.gz
|
||||
shell: bash
|
||||
- name: extract dist
|
||||
run: |
|
||||
tar xzf dist.tar.gz
|
||||
shell: bash
|
||||
- name: extract adf cli
|
||||
run: |
|
||||
tar xzf adf-cli.tar.gz
|
||||
tar xzf adf-testing.tar.gz
|
||||
shell: bash
|
||||
- name: show files
|
||||
shell: bash
|
||||
run: |
|
||||
pwd
|
||||
ls -lha
|
||||
echo "====DIST===="
|
||||
find dist -maxdepth 1 -type d
|
||||
echo "====NXCACHE===="
|
||||
find nxcache -maxdepth 1 -type d
|
||||
echo "====ADF===="
|
||||
find node_modules/@alfresco/ -maxdepth 1 -type d
|
||||
@@ -0,0 +1,27 @@
|
||||
name: "Download build artifacts"
|
||||
description: "Download build artifacts"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: download and extract artifacts from s3
|
||||
shell: bash
|
||||
env:
|
||||
REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}"
|
||||
run: |
|
||||
packages=( dist nxcache node_modules )
|
||||
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
|
||||
du -h $i.tar.gz
|
||||
time tar xzf $i.tar.gz
|
||||
done
|
||||
- name: show files
|
||||
shell: bash
|
||||
run: |
|
||||
pwd
|
||||
ls -lha
|
||||
echo "====DIST===="
|
||||
find dist -maxdepth 1 -type d
|
||||
echo "====NXCACHE===="
|
||||
find nxcache -maxdepth 1 -type d
|
||||
echo "====ADF===="
|
||||
find node_modules/@alfresco/ -maxdepth 1 -type d
|
||||
@@ -129,6 +129,7 @@ runs:
|
||||
echo "NX_CALCULATION_FLAGS=$NX_CALCULATION_FLAGS" >> $GITHUB_ENV
|
||||
GIT_HASH=$(echo $GIT_HASH | sed "s@'@@g")
|
||||
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV
|
||||
|
||||
- name: run test with retries
|
||||
id: retry_run
|
||||
env:
|
||||
@@ -136,6 +137,7 @@ runs:
|
||||
PROVIDER: "${{ inputs.e2e-test-provider }}"
|
||||
AUTH_TYPE: "${{ inputs.e2e-test-auth }}"
|
||||
E2E_TEST_ID: "${{ inputs.e2e-test-id }}"
|
||||
|
||||
uses: nick-fields/retry@v2.8.2
|
||||
with:
|
||||
timeout_minutes: 40
|
||||
@@ -145,9 +147,15 @@ runs:
|
||||
command: |
|
||||
set -u;
|
||||
export GH_ACTION_RETRY_COUNT=$(cat ${GITHUB_OUTPUT} | grep -E '^[0-9]{1,2}$' | tail -n1)
|
||||
echo "RETRY GH_ACTION_RETRY_COUNT = <$GH_ACTION_RETRY_COUNT>"
|
||||
bash ./scripts/travis/e2e/e2e.sh "$E2E_TEST_ID" || exit 1
|
||||
|
||||
echo "RETRY GH_ACTION_RETRY_COUNT = <$GH_ACTION_RETRY_COUNT>"
|
||||
if [[ ${{ inputs.e2e-test-folder }} == 'content-services/upload' ]]; then
|
||||
export DISPLAY=:99
|
||||
chromedriver --url-base=/wd/hub &
|
||||
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
|
||||
bash ./scripts/travis/e2e/e2e.sh "$E2E_TEST_ID" "browser" || exit 1
|
||||
else
|
||||
bash ./scripts/travis/e2e/e2e.sh "$E2E_TEST_ID" || exit 1
|
||||
fi
|
||||
- name: upload smartrunner tests results on s3 to cache tests
|
||||
shell: bash
|
||||
if: always()
|
||||
@@ -157,5 +165,3 @@ runs:
|
||||
run: |
|
||||
tar czf "${{ inputs.e2e-tar-name }}" "${SMART_RUNNER_PATH}"
|
||||
aws s3 cp "${{ inputs.e2e-tar-name }}" "${S3_BUILD_BUCKET}/adf/$REMOTE_PATH"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
name: 'enable dryrun'
|
||||
description: 'check if must run pipeline in dryrun mode'
|
||||
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
description: 'enable dryrun'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
outputs:
|
||||
dryrun:
|
||||
description: "long sha of the tag"
|
||||
value: ${{ steps.dryrun.outputs.dryrun }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: set dryrun flag to TRUE
|
||||
shell: bash
|
||||
id: dryrun
|
||||
run: |
|
||||
if [[ '${{ inputs.dry-run-flag }}' == 'true' ]]; then
|
||||
echo "dryrun=--dryrun" >> $GITHUB_OUTPUT;
|
||||
echo "enabling dryrun"
|
||||
else
|
||||
echo "dryrun=" >> $GITHUB_OUTPUT;
|
||||
echo "dryrun NOT enabled"
|
||||
fi
|
||||
@@ -0,0 +1,19 @@
|
||||
name: 'Check NPM bundle'
|
||||
description: 'check npm bundle'
|
||||
|
||||
outputs:
|
||||
tag_sha:
|
||||
description: "long sha of the tag"
|
||||
value: ${{ steps.sha_out.outputs.tag_sha }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
steps:
|
||||
- name: check npm bundle
|
||||
shell: bash
|
||||
id: sha_out
|
||||
run: |
|
||||
ADF_VERSION=$(npm view @alfresco/adf-core@${TAG_NPM} version)
|
||||
echo "check bundle on TAG_NPM='${TAG_NPM}' and ADF_VERSION='${ADF_VERSION}'"
|
||||
./scripts/travis/build/npm-check-bundles.sh -v ${ADF_VERSION}
|
||||
@@ -0,0 +1,13 @@
|
||||
name: 'Install Google Chrome'
|
||||
description: 'Install Google Chrome'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install google chrome
|
||||
shell: bash
|
||||
run: |
|
||||
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
||||
sudo apt install ./google-chrome-stable_current_amd64.deb
|
||||
sudo ln -s /usr/bin/google-chrome /usr/bin/chrome
|
||||
chrome --version
|
||||
@@ -27,7 +27,6 @@ runs:
|
||||
cache-name: node-cache
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
~/.npm
|
||||
nxcache
|
||||
dist
|
||||
@@ -36,6 +35,20 @@ runs:
|
||||
node-${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
node-${{ runner.os }}-build-
|
||||
node-${{ runner.os }}-
|
||||
- name: Node Modules cache
|
||||
id: node-modules-cache
|
||||
if: ${{ inputs.enable-node-modules-cache == 'true' }}
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: node-modules-cache
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
key: .npm-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}-${{ steps.tag-sha.outputs.tag_sha }}
|
||||
restore-keys: |
|
||||
node_modules-${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
node_modules-${{ runner.os }}-build-
|
||||
node_modules-${{ runner.os }}-
|
||||
- name: pip cache
|
||||
uses: actions/cache@v3
|
||||
if: ${{ inputs.enable-cache == 'true' }}
|
||||
@@ -43,7 +56,7 @@ runs:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-
|
||||
restore-keys: |
|
||||
${{ runner.os }}
|
||||
${{ runner.os }}
|
||||
# ENV LOAD
|
||||
- name: load .travis.yml env.global variables
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/travis-env-load@v1.17.0
|
||||
|
||||
@@ -16,6 +16,7 @@ runs:
|
||||
EVENT_TYPE=""
|
||||
TRAVIS_PULL_REQUEST_BRANCH=""
|
||||
TRAVIS_BRANCH=""
|
||||
TAG_NPM=""
|
||||
REGEX="(repository|workflow)_dispatch"
|
||||
if [[ "${{ inputs.event_name }}" == "schedule" ]]; then
|
||||
EVENT_TYPE="cron";
|
||||
@@ -29,6 +30,14 @@ runs:
|
||||
elif [[ "${{ inputs.event_name }}" =~ $REGEX ]]; then
|
||||
EVENT_TYPE="api";
|
||||
fi
|
||||
|
||||
if [[ GITHUB_REF_NAME == "master" ]]; then
|
||||
TAG_NPM="latest"
|
||||
fi
|
||||
if [[ GITHUB_REF_NAME == "develop" ]]; then
|
||||
TAG_NPM="alpha"
|
||||
fi
|
||||
echo "TAG_NPM=${TAG_NPM}" >> $GITHUB_ENV
|
||||
echo "TRAVIS_EVENT_TYPE=${EVENT_TYPE}" >> $GITHUB_ENV
|
||||
echo "TRAVIS_PULL_REQUEST_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH}" >> $GITHUB_ENV
|
||||
echo "TRAVIS_BRANCH=${TRAVIS_BRANCH}" >> $GITHUB_ENV
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
name: "Upload build artifacts"
|
||||
description: "Upload build artifacts"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
## NXCACHE
|
||||
- name: tar artifacts
|
||||
run: |
|
||||
tar czf dist.tar.gz dist
|
||||
tar czf nxcache.tar.gz nxcache
|
||||
tar czf adf-cli.tar.gz node_modules/@alfresco/adf-cli
|
||||
tar czf adf-testing.tar.gz node_modules/@alfresco/adf-testing
|
||||
shell: bash
|
||||
- name: update NX cache folder
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: nxcache.tar.gz
|
||||
name: nxcache
|
||||
## DIST
|
||||
- name: update Dist folder
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: dist.tar.gz
|
||||
name: dist
|
||||
## ADF CLI
|
||||
- name: save ADF cli
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: adf-cli.tar.gz
|
||||
name: adf-cli
|
||||
## ADF TESTING
|
||||
- name: save ADF testing
|
||||
uses: actions/upload-artifact@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: adf-testing.tar.gz
|
||||
name: adf-testing
|
||||
@@ -0,0 +1,19 @@
|
||||
name: "Upload build artifacts"
|
||||
description: "Upload build artifacts"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: tar and upload artifacts
|
||||
shell: bash
|
||||
env:
|
||||
REMOTE_PATH: "alfresco-ng2-components/build-cache/${{ github.run_id }}"
|
||||
run: |
|
||||
packages=( dist nxcache node_modules )
|
||||
for i in "${packages[@]}"; do
|
||||
time tar czf $i.tar.gz $i
|
||||
du -h $i.tar.gz
|
||||
time aws s3 cp --no-progress $i.tar.gz s3://${S3_BUILD_BUCKET_SHORT_NAME}/${REMOTE_PATH}/$i.tar.gz
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user