-
Notifications
You must be signed in to change notification settings - Fork 4
81 lines (75 loc) · 2.71 KB
/
install.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
on:
workflow_call:
inputs:
method:
description: installation method ['tarball', 'npm', 'installer']
type: string
required: true
cli:
description: cli to test ['sf']
type: string
required: true
channel:
description: channel to test ['stable', 'stable-rc']
type: string
default: stable
required: false
runs-on:
description: runner name/label
type: string
required: true
base:
required: false
type: string
description: platform-cli (do not change)
default: platform-cli
jobs:
install:
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
outputs:
metricName: count#${{inputs.base}}.${{ inputs.cli }}.${{ inputs.channel }}.${{ inputs.method }}.${{ steps.lowercaseOS.outputs.lowercase }}.success
metricValue: ${{ steps.posix.outputs.metricValue || steps.windows.outputs.metricValue }}
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: salesforcecli/github-workflows/.github/actions/retry@main
with:
timeout_minutes: 60
retry_wait_seconds: 60
max_attempts: 5
command: npm install -g @salesforce/plugin-release-management@latest
- id: lowercaseOS
uses: ASzc/change-string-case-action@0bb41b609de8e18205c8c2c586c9b23553f2c08e
with:
string: ${{ runner.os }}
- run: sf-release cli:install:test --cli ${{ inputs.cli}} --method ${{ inputs.method }} --channel ${{ inputs.channel }}
continue-on-error: true
- if: steps.lowercaseOS.outputs.lowercase != 'windows'
id: posix
run: |
echo "status is $(jq .status test-results.json)"
status_num=$(jq .status test-results.json)
[[ $status_num = 0 ]] && status="Passed" || status="Failed"
echo "{metricValue}={$status}" >> $GITHUB_OUTPUT
continue-on-error: true
- if: steps.lowercaseOS.outputs.lowercase == 'windows'
id: windows
run: |
$result = Get-Content 'test-results.json' | Out-String | ConvertFrom-Json
$status = if ($result.status -eq 0) { "Passed" } else { "Failed" }
echo "{metricValue}={$status}" >> $GITHUB_OUTPUT
echo "status is $status"
shell: pwsh
continue-on-error: true
report:
needs: [install]
uses: ./.github/workflows/report.yml
with:
metricName: ${{ needs.install.outputs.metricName }}
metricValue: ${{ needs.install.outputs.metricValue }}
secrets: inherit