Skip to content

Commit

Permalink
[ACS-6543] switch from aws to gha cache (#3582)
Browse files Browse the repository at this point in the history
* switch to gha cache

* save cache

* use exact path

* improve cache key

* cleanup

* cleanup

* remove npm registry var

* remove codeowners
  • Loading branch information
DenysVuika authored Jan 4, 2024
1 parent 43f16a0 commit 33c3d6f
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 209 deletions.
38 changes: 0 additions & 38 deletions .github/CODEOWNERS

This file was deleted.

35 changes: 0 additions & 35 deletions .github/actions/before-e2e/action.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,13 @@
name: "Before e2e"
description: "Before e2e"

inputs:
from:
description: 'path to download the artifact'
required: true
type: string
to:
description: 'path to save artifact to'
required: true
type: string
id:
description: 'test suite id'
required: true
type: number
aws-access-key-id:
description: 'aws access key id'
required: true
type: string
aws-secret-access-key:
description: 'aws secret access key'
required: true
type: string
aws-region:
description: 'aws region'
required: true
type: string

runs:
using: "composite"
steps:
- name: Check content UP
shell: bash
run: ./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host $BASE_URL -u $ADMIN_EMAIL -p $ADMIN_PASSWORD || exit 1

- name: Download artifacts
uses: ./.github/actions/download-job-artifact
with:
artifact: ${{ inputs.from }}
output: ${{ inputs.to }}
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: ${{ inputs.aws-region }}

- name: Install google chrome
shell: bash
run: |
Expand Down
18 changes: 0 additions & 18 deletions .github/actions/before-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@ runs:
steps:
- uses: ./.github/actions/setup

- name: setup S3 caching
shell: bash
run: |
S3_DBP_PATH="s3://alfresco-travis-builds/aca"
if [ "${{ github.event_name }}" == "push" ]; then
S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/$BRANCH_NAME"
elif [ "${{ github.event_name }}" == "pull_request" ]; then
S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/$BRANCH_NAME"
echo "BASE_HASH=origin/$BRANCH_NAME" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "schedule" ]; then
S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/cron"
else
S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/api"
fi
echo "S3_DBP_FOLDER="$S3_DBP_ROOT_FOLDER/${{ github.run_id }}"" >> $GITHUB_ENV
- name: ADF linking
if: ${{ github.event_name == 'pull_request'}}
uses: ./.github/actions/adf-linking
45 changes: 0 additions & 45 deletions .github/actions/download-job-artifact/action.yml

This file was deleted.

6 changes: 1 addition & 5 deletions .github/actions/publish-libs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ inputs:
description: 'Github token'
required: true
type: string
npm_registry_address:
description: 'NPM registry address'
required: true
type: string
npm_registry_token:
description: 'NPM registry token'
required: true
Expand Down Expand Up @@ -59,7 +55,7 @@ runs:
name: setup NPM registry
with:
node-version-file: '.nvmrc'
registry-url: 'https://${{ inputs.npm_registry_address }}'
registry-url: 'https://registry.npmjs.org'
scope: '@alfresco'

- name: Publish to NPM registry
Expand Down
41 changes: 0 additions & 41 deletions .github/actions/upload-job-artifact/action.yml

This file was deleted.

45 changes: 22 additions & 23 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ env:
CONTENT_IDENTITY_PASSWORD: ${{ secrets.CONTENT_IDENTITY_PASSWORD }}
SCREENSHOT_USERNAME: ${{ secrets.SCREENSHOT_USERNAME }}
SCREENSHOT_PASSWORD: ${{ secrets.SCREENSHOT_PASSWORD}}
AWS_REGION: "eu-west-2"
CONTENT_CE_DIST_PATH: "./dist/content-ce"
PLAYWRIGHT_E2E_HOST: ${{ secrets.PLAYWRIGHT_E2E_HOST }}
GH_BUILD_NUMBER: ${{ github.run_id }}
MAXINSTANCES: 2
Expand Down Expand Up @@ -66,15 +64,13 @@ jobs:
- uses: ./.github/actions/before-install
- run: npm ci
- run: npm run build -- $BUILD_OPTS
- name: upload job artifact

- name: dist cache
if: ${{ success() }}
uses: ./.github/actions/upload-job-artifact
uses: actions/cache/save@v3
with:
artifact: $CONTENT_CE_DIST_PATH
output: $S3_DBP_FOLDER/alfresco-content-app.tar.bz2
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
path: ./dist/content-ce
key: cache-dist-${{ github.run_id }}

unit-tests:
needs: [lint, build]
Expand Down Expand Up @@ -136,14 +132,15 @@ jobs:
cache: 'npm'
- uses: ./.github/actions/before-install
- run: npm ci
- uses: ./.github/actions/before-e2e

- uses: actions/cache/restore@v3
id: cache
with:
from: "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2"
to: $CONTENT_CE_DIST_PATH
id: ${{ matrix.e2e-suites.id }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
path: ./dist/content-ce
key: cache-dist-${{ github.run_id }}

- uses: ./.github/actions/before-e2e

- uses: ./.github/actions/run-e2e
with:
options: "--suite=${{ matrix.e2e-suites.name }}"
Expand Down Expand Up @@ -189,16 +186,18 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: 'npm'

- uses: ./.github/actions/before-install
- run: npm ci
- uses: ./.github/actions/before-e2e

- uses: actions/cache/restore@v3
id: cache
with:
from: "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2"
to: $CONTENT_CE_DIST_PATH
id: 15
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
path: ./dist/content-ce
key: cache-dist-${{ github.run_id }}

- uses: ./.github/actions/before-e2e

- name: before playwright
shell: bash
run: npx playwright install chromium
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ env:
BASE_URL: ${{ secrets.PIPELINE_ENV_URL }}
ADMIN_EMAIL: ${{ secrets.PIPELINE_ADMIN_USERNAME }}
ADMIN_PASSWORD: ${{ secrets.PIPELINE_ADMIN_PASSWORD }}
AWS_REGION: "eu-west-2"
CONTENT_CE_DIST_PATH: "./dist/content-ce"
PLAYWRIGHT_E2E_HOST: ${{ secrets.PLAYWRIGHT_E2E_HOST }}
NPM_REGISTRY_ADDRESS: ${{ secrets.NPM_REGISTRY_ADDRESS }}

jobs:
publish-docker-registry:
Expand Down Expand Up @@ -131,7 +128,6 @@ jobs:
with:
branch_name: ${{ env.BRANCH_NAME }}
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
npm_registry_address: ${{ vars.NPM_REGISTRY_ADDRESS }}
npm_registry_token: ${{ secrets.NPM_REGISTRY_TOKEN }}
npm_tag: ${{ env.TAG_NPM }}
dry-run: ${{ inputs.dry-run-release }}

0 comments on commit 33c3d6f

Please sign in to comment.