ci(actions): add Dependabot config and upgrade actions to latest vers… #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Reusable Node (pnpm) CI | ||
|
Check failure on line 1 in .github/workflows/node-pnpm.yml
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| node-version: | ||
| description: Node.js version | ||
| required: false | ||
| type: string | ||
| pnpm-version: | ||
| description: pnpm version | ||
| required: false | ||
| type: string | ||
| working-directory: | ||
| description: Directory with package.json | ||
| required: false | ||
| type: string | ||
| default: "." | ||
| frozen-lockfile: | ||
| description: Use --frozen-lockfile | ||
| required: false | ||
| type: boolean | ||
| default: true | ||
| build-script: | ||
| description: Name of build script to run | ||
| required: false | ||
| type: string | ||
| default: "build" | ||
| test-script: | ||
| description: Name of test script to run | ||
| required: false | ||
| type: string | ||
| default: "test" | ||
| test-args: | ||
| description: Additional args to pass to test script | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| registry-url: | ||
| description: Optional npm registry URL | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| secrets: | ||
| NPM_TOKEN: | ||
| required: false | ||
| env: | ||
| NODE_VERSION: ${{ inputs.node-version || '20' }} | ||
| PNPM_VERSION: ${{ inputs.pnpm-version || '9' }} | ||
| jobs: | ||
| node: | ||
| name: Node (pnpm) Build & Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Configure npm auth (if token provided) | ||
| if: ${{ inputs.registry-url != '' && secrets.NPM_TOKEN != '' }} | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| REG="${{ inputs.registry-url }}" | ||
| HOST=$(echo "$REG" | sed -E 's#^https?://##') | ||
| case "$HOST" in | ||
| */) ;; | ||
| *) HOST="$HOST/" ;; | ||
| esac | ||
| npm config set //${HOST}:_authToken="${{ secrets.NPM_TOKEN }}" | ||
| - name: Setup Node & pnpm | ||
| uses: ./.github/actions/pnpm-setup | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| pnpm-version: ${{ env.PNPM_VERSION }} | ||
| registry-url: ${{ inputs.registry-url }} | ||
| - name: Install | ||
| uses: ./.github/actions/pnpm-install | ||
| with: | ||
| working-directory: ${{ inputs.working-directory }} | ||
| frozen-lockfile: ${{ inputs.frozen-lockfile }} | ||
| - name: Build | ||
| uses: ./.github/actions/pnpm-build | ||
| with: | ||
| working-directory: ${{ inputs.working-directory }} | ||
| script: ${{ inputs.build-script }} | ||
| - name: Test | ||
| uses: ./.github/actions/node-test | ||
| with: | ||
| working-directory: ${{ inputs.working-directory }} | ||
| script: ${{ inputs.test-script }} | ||
| args: ${{ inputs.test-args }} | ||