@@ -2,11 +2,21 @@ name: run-tests
2
2
on :
3
3
workflow_call :
4
4
inputs :
5
- use-scanner-tarball :
5
+ use-scanner-tarballs :
6
6
description : ' If true, install scanner via tarball'
7
7
required : false
8
8
type : boolean
9
9
default : false
10
+ v4-tarball-suffix :
11
+ description : ' The suffix attached to the name of the v4 tarball'
12
+ required : false
13
+ type : string
14
+ default : ' dev-4'
15
+ v5-tarball-suffix :
16
+ description : ' The suffix attached to the name of the v5 tarball'
17
+ required : false
18
+ type : string
19
+ default : ' dev'
10
20
target-branch :
11
21
description : " What branch should be checked out?"
12
22
required : false
34
44
with :
35
45
distribution : ' temurin'
36
46
java-version : ' 11' # Always use Java v11 for running tests.
47
+ - uses : actions/setup-python@v5
48
+ with :
49
+ python-version : 3.12
37
50
- name : ' Install node module dependencies'
38
51
run : yarn install --frozen-lockfile
39
52
# We'll need to install the CLI tool, since some of the tests
@@ -44,34 +57,62 @@ jobs:
44
57
# of the tests are integration tests.
45
58
# NOTE: SFCA can come from a tarball built in a previous step,
46
59
# or be installed as the currently-latest version.
47
- - name : Download Scanner Tarball
48
- if : ${{ inputs.use-scanner-tarball == true }}
49
- id : download
60
+ - name : Download v4 Scanner Tarball
61
+ if : ${{ inputs.use-scanner-tarballs == true }}
62
+ id : download-v4
63
+ uses : actions/download-artifact@v4
64
+ with :
65
+ name : scanner-tarball-${{ inputs.v4-tarball-suffix}}
66
+ # Download the tarball to a subdirectory of HOME, so it's guaranteed
67
+ # to be somewhere the installation command can see.
68
+ path : ~/downloads/tarball-v4
69
+ - name : Install v4 Scanner Tarball
70
+ if : ${{ inputs.use-scanner-tarballs == true }}
71
+ shell : bash
72
+ run : |
73
+ # Determine the tarball's name.
74
+ TARBALL_NAME=$(ls ~/downloads/tarball-v4/sfdx-scanner | grep salesforce-.*\\.tgz)
75
+ echo $TARBALL_NAME
76
+ # Figure out where the tarball was downloaded to.
77
+ # To allow compatibility with Windows, replace backslashes with forward slashes
78
+ # and rip off a leading `C:` if present.
79
+ DOWNLOAD_PATH=`echo '${{ steps.download-v4.outputs.download-path }}' | tr '\\' '/'`
80
+ echo $DOWNLOAD_PATH
81
+ DOWNLOAD_PATH=`[[ $DOWNLOAD_PATH = C* ]] && echo $DOWNLOAD_PATH | cut -d':' -f 2 || echo $DOWNLOAD_PATH`
82
+ echo $DOWNLOAD_PATH
83
+ # Pipe in a `y` to simulate agreeing to install an unsigned package. Use a URI of the file's full path.
84
+ echo y | sf plugins install "file://${DOWNLOAD_PATH}/sfdx-scanner/${TARBALL_NAME}"
85
+ - name : Download v5 Scanner Tarball
86
+ if : ${{ inputs.use-scanner-tarballs == true }}
87
+ id : download-v5
50
88
uses : actions/download-artifact@v4
51
89
with :
52
- name : scanner-tarball
90
+ name : scanner-tarball-${{ inputs.v5-tarball-suffix }}
53
91
# Download the tarball to a subdirectory of HOME, so it's guaranteed
54
92
# to be somewhere the installation command can see.
55
- path : ~/downloads/tarball
56
- - name : Install Scanner Tarball
57
- if : ${{ inputs.use-scanner-tarball == true }}
93
+ path : ~/downloads/tarball-v5
94
+ - name : Install v5 Scanner Tarball
95
+ if : ${{ inputs.use-scanner-tarballs == true }}
58
96
shell : bash
59
97
run : |
60
98
# Determine the tarball's name.
61
- TARBALL_NAME=$(ls ~/downloads/tarball/sfdx-scanner | grep salesforce-sfdx-scanner-[0-9]*\\.[0-9]*\\.[0-9] *\\.tgz)
99
+ TARBALL_NAME=$(ls ~/downloads/tarball-v5 /sfdx-scanner | grep salesforce-. *\\.tgz)
62
100
echo $TARBALL_NAME
63
101
# Figure out where the tarball was downloaded to.
64
102
# To allow compatibility with Windows, replace backslashes with forward slashes
65
103
# and rip off a leading `C:` if present.
66
- DOWNLOAD_PATH=`echo '${{ steps.download.outputs.download-path }}' | tr '\\' '/'`
104
+ DOWNLOAD_PATH=`echo '${{ steps.download-v5 .outputs.download-path }}' | tr '\\' '/'`
67
105
echo $DOWNLOAD_PATH
68
106
DOWNLOAD_PATH=`[[ $DOWNLOAD_PATH = C* ]] && echo $DOWNLOAD_PATH | cut -d':' -f 2 || echo $DOWNLOAD_PATH`
69
107
echo $DOWNLOAD_PATH
70
108
# Pipe in a `y` to simulate agreeing to install an unsigned package. Use a URI of the file's full path.
71
109
echo y | sf plugins install "file://${DOWNLOAD_PATH}/sfdx-scanner/${TARBALL_NAME}"
72
- - name : Install Production scanner
73
- if : ${{ inputs.use-scanner-tarball == false }}
110
+ - name : Install Production scanner v4
111
+ if : ${{ inputs.use-scanner-tarballs == false }}
74
112
run : sf plugins install @salesforce/sfdx-scanner
113
+ - name : Install Production scanner v5
114
+ if : ${{ inputs.use-scanner-tarballs == false }}
115
+ run : sf plugins install code-analyzer
75
116
# Run the tests. (Linux and non-Linux need slightly different commands.)
76
117
- name : ' Run Tests (Linux)'
77
118
run : xvfb-run -a yarn test
0 commit comments