Checking new workflow

This commit is contained in:
VitoAlbano
2025-04-15 10:51:57 +01:00
parent e5295e5418
commit a00251c518
2 changed files with 4 additions and 57 deletions

View File

@@ -19,24 +19,11 @@ inputs:
runs: runs:
using: "composite" using: "composite"
steps: steps:
- name: install NPM
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version-file: '.nvmrc'
cache-dependency-path: package-lock.json
- name: get latest tag sha - name: get latest tag sha
id: tag-sha id: tag-sha
uses: Alfresco/alfresco-build-tools/.github/actions/git-latest-tag@a3d5beb67a8b8d96398435e01686a9a9185380ab # v8.18.0 uses: Alfresco/alfresco-build-tools/.github/actions/git-latest-tag@a3d5beb67a8b8d96398435e01686a9a9185380ab # v8.18.0
- name: load "NPM TAG" - name: load "NPM TAG"
uses: ./.github/actions/set-npm-tag uses: ./.github/actions/set-npm-tag
- name: pip cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
if: ${{ inputs.enable-cache == 'true' }}
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-
restore-keys: |
${{ runner.os }}
- name: Cache node modules - name: Cache node modules
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with: with:

View File

@@ -184,50 +184,10 @@ jobs:
npx nx run cli:bundle npx nx run cli:bundle
- uses: ./.github/actions/upload-node-modules-and-artifacts - uses: ./.github/actions/upload-node-modules-and-artifacts
generate-affected-matrix:
name: "Generate affected matrix"
runs-on: ubuntu-latest
needs: ["pre-checks", "check-if-pr-is-approved"]
outputs:
unitMatrix: ${{ steps.set-matrix.outputs.unitMatrix }}
buildMatrix: ${{ steps.set-matrix.outputs.buildMatrix }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
- name: Cache node modules
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
run: npm ci
- name: Generate affected projects matrix
id: set-matrix
run: |
BASE_REF="${{ github.event.pull_request.base.ref }}"
echo "Base ref is $BASE_REF"
AFFECTED_BUILD=$(npx nx show projects --affected --target=test --base=origin/$BASE_REF --select=projects --plain --exclude=stories)
AFFECTED_UNIT=$(npx nx show projects --affected --target=test --base=origin/$BASE_REF --select=projects --plain --exclude=cli,stories,eslint-angular)
echo "Affected projects for BUILD : $AFFECTED_BUILD"
BUILD_MATRIX_JSON=$(echo $AFFECTED_BUILD | xargs -n1 | jq -R -s -c 'split("\n")[:-1] | map({ "project": . })')
BUILD_MATRIX_JSON=$(echo "$BUILD_MATRIX_JSON" | tr -d '\n' | sed 's/"$//')
echo "Matrix BUILD: $BUILD_MATRIX_JSON"
echo "buildMatrix=$BUILD_MATRIX_JSON" >> $GITHUB_OUTPUT
echo "Affected projects for UNIT : $AFFECTED_UNIT"
UNIT_MATRIX_JSON=$(echo $AFFECTED_UNIT | xargs -n1 | jq -R -s -c 'split("\n")[:-1] | map({ "project": . })')
UNIT_MATRIX_JSON=$(echo "$UNIT_MATRIX_JSON" | tr -d '\n' | sed 's/"$//')
echo "Matrix UNIT: $UNIT_MATRIX_JSON"
echo "unitMatrix=$UNIT_MATRIX_JSON" >> $GITHUB_OUTPUT
lint: lint:
name: "Lint" name: "Lint"
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [pre-checks, check-if-pr-is-approved] needs: [pre-checks, check-if-pr-is-approved, setup]
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -238,12 +198,12 @@ jobs:
trigger-build: trigger-build:
name: "Build Libs" name: "Build Libs"
needs: [pre-checks, check-if-pr-is-approved] needs: [pre-checks, check-if-pr-is-approved, setup]
uses: ./.github/workflows/build-lib-workflow.yml uses: ./.github/workflows/build-lib-workflow.yml
build-storybook: build-storybook:
name: "Build Storybook" name: "Build Storybook"
needs: [pre-checks, check-if-pr-is-approved] needs: [pre-checks, check-if-pr-is-approved, setup]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
@@ -258,7 +218,7 @@ jobs:
trigger-unit-tests: trigger-unit-tests:
name: "Unit Tests" name: "Unit Tests"
needs: [pre-checks, check-if-pr-is-approved] needs: [pre-checks, check-if-pr-is-approved, setup]
uses: ./.github/workflows/unit-test-workflow.yml uses: ./.github/workflows/unit-test-workflow.yml
finalize: finalize: