name: 'Setup' description: 'Initialize cache, env var load' inputs: enable-node-modules-cache: description: 'enable caching for node modules' required: false type: boolean default: 'true' act: description: 'enable act debug' required: false type: boolean default: 'false' outputs: npm-tag: description: 'NPM tag' value: ${{ steps.set-npm-tag.outputs.npm-tag }} runs: using: "composite" steps: - name: install NPM uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.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@40f2376b812403b51e0cea49eaff04c1b8d65cfd # v15.7.1 # CACHE - name: Node Modules cache id: node-modules-cache if: ${{ inputs.enable-node-modules-cache == 'true' }} uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 env: cache-name: node-modules-cache with: path: | node_modules key: .npm-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | .npm-${{ runner.os }}-build-${{ env.cache-name }}- .npm-${{ runner.os }}-build- .npm-${{ runner.os }}- - name: load "NPM TAG" id: set-npm-tag uses: ./.github/actions/set-npm-tag - name: before install script uses: ./.github/actions/before-install with: act: ${{ inputs.act }}