diff --git a/.github/workflows/just-nut.yml b/.github/workflows/just-nut.yml index 8cd69537..7a2b30ac 100644 --- a/.github/workflows/just-nut.yml +++ b/.github/workflows/just-nut.yml @@ -20,6 +20,11 @@ on: description: 'runs-on property, ex: ubuntu-latest, windows-latest' type: string default: 'ubuntu-latest' + jit: + required: false + description: 'install JIT plugin before running tests' + type: boolean + default: false workflow_call: inputs: channel-or-version: @@ -40,12 +45,18 @@ on: description: 'runs-on property, ex: ubuntu-latest, windows-latest' type: string default: 'ubuntu-latest' + jit: + required: false + description: 'install JIT plugin before running tests' + type: boolean + default: false jobs: just-nut: name: ${{inputs.repository}} runs-on: ${{inputs.os}} env: + GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }} TESTKIT_EXECUTABLE_PATH: sf TESTKIT_AUTH_URL: ${{ secrets.TESTKIT_AUTH_URL}} TESTKIT_HUB_USERNAME: ${{ secrets.TESTKIT_HUB_USERNAME}} @@ -59,7 +70,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - repository: ${{inputs.repository}} + repository: ${{ inputs.repository }} token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }} path: . - uses: actions/setup-node@v3 @@ -74,6 +85,19 @@ jobs: command: npm install -g @salesforce/cli@${{ inputs.channel-or-version }} --omit=dev timeout_minutes: 60 - uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main + # We set SF_DATA_DIR to ensure JIT plugins are only installed once + # Otherwise each TestSession reinstalls the JIT plugin in its custom HOME dir + - name: Set SF_DATA_DIR for JIT + if: ${{ inputs.jit }} + run: echo "SF_DATA_DIR=${{ runner.temp }}/sf-data-dir" >> "$GITHUB_ENV" + - name: Install JIT plugin + if: ${{ inputs.jit }} + # The --jit flag ensures we get the JIT plugin version set in the sf package.json + run: | + RAW_URL=$(gh browse package.json --repo "${{ inputs.repository }}" --no-browser | sed 's/github.com/raw.githubusercontent.com/' | sed 's/tree\/main/main/') + NPM_NAME=$(curl --silent "$RAW_URL" | jq -r '.name') + sf plugins install "$NPM_NAME" --jit + cat "${{ env.SF_DATA_DIR }}/package.json" - name: Run NUT (with retries) uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd with: diff --git a/.github/workflows/just-nuts.yml b/.github/workflows/just-nuts.yml index 9e1ef7cf..52d0735e 100644 --- a/.github/workflows/just-nuts.yml +++ b/.github/workflows/just-nuts.yml @@ -24,16 +24,11 @@ jobs: os: [ubuntu-latest, windows-latest] repository: - salesforcecli/plugin-auth - - salesforcecli/plugin-community - - salesforcecli/plugin-custom-metadata - salesforcecli/plugin-data - - salesforcecli/plugin-dev - - salesforcecli/plugin-env - salesforcecli/plugin-limits - salesforcecli/plugin-org - salesforcecli/plugin-schema - salesforcecli/plugin-settings - - salesforcecli/plugin-signups - salesforcecli/plugin-sobject - salesforcecli/plugin-templates - salesforcecli/plugin-user @@ -44,6 +39,30 @@ jobs: os: ${{matrix.os}} secrets: inherit + jit: + strategy: + fail-fast: false + max-parallel: 6 + matrix: + os: [ubuntu-latest, windows-latest] + repository: + - salesforcecli/plugin-custom-metadata + - salesforcecli/plugin-community + - salesforcecli/plugin-dev + - salesforcecli/plugin-signups + # - salesforce/plugin-devops-center + # - salesforcecli/plugin-env + # - salesforce/plugin-functions + # - salesforce/sfdx-plugin-lwc-test + # - salesforce/sfdx-scanner + uses: ./.github/workflows/just-nut.yml + with: + repository: ${{matrix.repository}} + channel-or-version: ${{ inputs.channel-or-version }} + os: ${{matrix.os}} + jit: true + secrets: inherit + packaging: strategy: fail-fast: false @@ -58,6 +77,7 @@ jobs: channel-or-version: ${{ inputs.channel-or-version }} os: ${{matrix.os}} command: ${{matrix.command}} + jit: true secrets: inherit source: