mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
Checking new workflow
This commit is contained in:
13
.github/actions/setup/action.yml
vendored
13
.github/actions/setup/action.yml
vendored
@@ -19,24 +19,11 @@ inputs:
|
||||
runs:
|
||||
using: "composite"
|
||||
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
|
||||
id: tag-sha
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/git-latest-tag@a3d5beb67a8b8d96398435e01686a9a9185380ab # v8.18.0
|
||||
- name: load "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
|
||||
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
|
||||
with:
|
||||
|
48
.github/workflows/pull-request.yml
vendored
48
.github/workflows/pull-request.yml
vendored
@@ -184,50 +184,10 @@ jobs:
|
||||
npx nx run cli:bundle
|
||||
- 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:
|
||||
name: "Lint"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [pre-checks, check-if-pr-is-approved]
|
||||
needs: [pre-checks, check-if-pr-is-approved, setup]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
@@ -238,12 +198,12 @@ jobs:
|
||||
|
||||
trigger-build:
|
||||
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
|
||||
|
||||
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
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -258,7 +218,7 @@ jobs:
|
||||
|
||||
trigger-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
|
||||
|
||||
finalize:
|
||||
|
Reference in New Issue
Block a user