name: "Setup"
description: "Setup js environment and dependencies"
runs:
  using: "composite"

  steps:
    - name: Use Node.js
      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #v4.4.0
      with:
        node-version: 22.16.0
        cache: 'npm'
        cache-dependency-path: '**/package-lock.json'
    - name: Get @signalapp/sqlcipher cached location
      shell: bash
      run: |
        echo "node_sqlcipher_path=$(node buildSrc/getNativeCacheLocation.js @signalapp/sqlcipher)" >> $GITHUB_ENV
    - name: try to use @signalapp/sqlcipher
      uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 #v4.2.3
      with:
        path: ${{ env.node_sqlcipher_path }}
        key: ${{ env.node_sqlcipher_path }}
    - name: install packages
      shell: bash
      run: npm ci