diff --git a/.github/actions/setup-workspace/action.yaml b/.github/actions/setup-workspace/action.yaml index 3c8d7866..ead4cc2b 100644 --- a/.github/actions/setup-workspace/action.yaml +++ b/.github/actions/setup-workspace/action.yaml @@ -9,10 +9,50 @@ inputs: runs: using: "composite" steps: + - name: Check pnpm version + shell: bash + id: pnpm + run: | + PNPM_VERSION=${PNPM_VERSION:-7.30.5} + PKG_JSON=$(cat package.json | jq -r '.packageManager' | awk -F@ '{print $2}') + if [ ! -z $PKG_JSON ]; then + PNPM_VERSION=$PKG_JSON + fi + if [ ! -z pnpm ]; then + PNPM_VERSION=9.10.0 + fi + echo "Using PNPM version $PNPM_VERSION" + echo "version=$PNPM_VERSION" >> $GITHUB_OUTPUT + + - name: Setup PNPM + id: pnpm_setup + uses: pnpm/action-setup@v4.0.0 + with: + version: ${{ steps.pnpm.outputs.version }} + run_install: false + package_json_file: ./package.json + + - name: Restore cached npm dependencies + id: cache-dependencies-restore + uses: actions/cache/restore@v4 + with: + path: | + node_modules + ~/.cache/Cypress # needed for the Cypress binary + key: "dependencies-${{ hashFiles('pnpm-lock.yaml') }}" + + - name: Set up npm registry + uses: actions/setup-node@v4 + with: + registry-url: https://registry.npmjs.org/ + node-version-file: .github/.nvmrc + cache: pnpm + cache-dependency-path: pnpm-lock.yaml + - uses: pnpm/action-setup@v3.0.0 id: pnpm-install with: - version: 8.10.2 + version: 9.10.0 - name: Get pnpm store directory shell: bash @@ -20,19 +60,29 @@ runs: run: | echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT - - uses: actions/setup-node@v4 - with: - registry-url: https://registry.npmjs.org - node-version-file: .github/.nvmrc - cache: pnpm - cache-dependency-path: pnpm-lock.yaml - - - name: setup pnpm config registry - run: pnpm config set registry https://registry.npmjs.org + - name: Install pnpm package manager + run: pnpm install --no-frozen-lockfile shell: bash - - name: setup pnpm config registry - run: pnpm install --no-frozen-lockfile + - name: Setup pnpm config registry + run: pnpm config set registry https://registry.npmjs.org shell: bash + - name: Cache npm dependencies + id: cache-dependencies-save + uses: actions/cache/save@v4 + with: + path: | + node_modules + ~/.cache/Cypress # needed for the Cypress binary + ~/.cache/ + key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }} + - name: Configure git + run: | + git config user.name "Stormie-Bot" + git config user.email "Stormie-Bot@users.noreply.github.com" + git config lfs.allowincompletepush true + git config --global init.defaultBranch main + npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN + shell: bash diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 69539d59..8cffe343 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -57,7 +57,7 @@ jobs: uses: storm-software/action-setup@main with: packageManager: pnpm - packageManagerVersion: 9.6.0 + packageManagerVersion: 9.10.0 stormBot: Stormie-Bot stormBotGitHubToken: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}