-
Notifications
You must be signed in to change notification settings - Fork 25
103 lines (97 loc) · 3.63 KB
/
just-nut.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: just-nut
on:
workflow_dispatch:
inputs:
channel-or-version:
description: Version or channel of the CLI to test against (nightly, latest-rc, 2.1.1)
type: string
required: true
repository:
description: 'The repo that will be cloned (format: owner/repo). This contains the NUTs you want to run. Ex: salesforcecli/plugin-user'
type: string
required: true
command:
required: false
type: string
default: yarn test:nuts
description: 'command to execute (ex: yarn test:nuts)'
os:
required: false
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:
description: Version or channel of the CLI to test against (nightly, latest-rc, 2.1.1)
type: string
required: true
repository:
description: 'The repo that will be cloned (format: owner/repo). This contains the NUTs you want to run. Ex: salesforcecli/plugin-user'
type: string
required: true
command:
required: false
type: string
default: yarn test:nuts
description: 'command to execute (ex: yarn test:nuts)'
os:
required: false
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}}
TESTKIT_JWT_CLIENT_ID: ${{ secrets.TESTKIT_JWT_CLIENT_ID}}
TESTKIT_JWT_KEY: ${{ secrets.TESTKIT_JWT_KEY}}
TESTKIT_HUB_INSTANCE: ${{ secrets.TESTKIT_HUB_INSTANCE}}
ONEGP_TESTKIT_AUTH_URL: ${{ secrets.ONEGP_TESTKIT_AUTH_URL }}
TESTKIT_SETUP_RETRIES: 2
SF_DISABLE_TELEMETRY: true
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
path: .
- uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION_OVERRIDE || 'lts/*' }}
# cache: yarn
- name: Install CLI
uses: salesforcecli/github-workflows/.github/actions/retry@main
with:
command: npm install -g @salesforce/cli@${{ inputs.channel-or-version }} --omit=dev
- 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: |
sf plugins install $(jq -r '.name' package.json) --jit
- name: Run NUT (with retries)
uses: salesforcecli/github-workflows/.github/actions/retry@main
with:
retry_wait_seconds: 1
command: ${{ inputs.command }}