-
Notifications
You must be signed in to change notification settings - Fork 2
132 lines (125 loc) · 4.48 KB
/
CI_Execution.yml
File metadata and controls
132 lines (125 loc) · 4.48 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: CI for feature branches on PR creation
# Controls when the workflow will run
on:
# Triggers the workflow on opened pull request events but only for the "develop" branch
pull_request:
branches:
- develop
types: ['opened', 'edited', 'synchronize']
paths-ignore: ['**.github/**']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
OS:
description: 'Comma-separated list of OS versions e.g. "windows-latest, ubuntu-latest"'
default: '"ubuntu-latest"'
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
provardx-ci-execution:
strategy:
matrix:
os: ${{ fromJSON(inputs.OS && format('[{0}]', inputs.OS) || '["ubuntu-latest", "macos-latest"]') }}
nodeversion: [20]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.nodeversion }}
- name: 'Cache node_modules'
uses: actions/cache@v4
with:
path: ${{ matrix.os == 'windows-latest' && 'C:\\Users\\runneradmin\\AppData\\Roaming\\npm-cache' || '~/.npm' }}
key: ${{ runner.os }}-node-v${{ matrix.nodeversion }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-v${{ matrix.nodeversion }}-
- name: 'sf installation'
run: |
npm install -g @salesforce/cli
- name: Determine Branch Name
if: matrix.os == 'windows-latest'
run: |
if ($env:GITHUB_HEAD_REF) {
echo "BRANCH_NAME=$env:GITHUB_HEAD_REF" | Out-File -FilePath $env:GITHUB_ENV -Append
} else {
echo "BRANCH_NAME=$(echo $env:GITHUB_REF -replace 'refs/heads/', '')" | Out-File -FilePath $env:GITHUB_ENV -Append
}
- name: Determine Branch Name for Ubuntu/Mac
if: matrix.os != 'windows-latest'
run: |
if [[ "${GITHUB_HEAD_REF}" ]]; then
echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
else
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
fi
shell: bash
- name: Check for target branch in Utils repo
id: check_branch
uses: actions/github-script@v6
with:
script: |
const branch = process.env.BRANCH_NAME;
let branchExists = false;
try {
await github.rest.repos.getBranch({
owner: 'ProvarTesting',
repo: 'provardx-plugins-utils',
branch: branch,
});
branchExists = true;
} catch (error) {
console.log(`Branch ${branch} does not exist, falling back to develop.`);
}
return branchExists;
- name: Check out Utils repo
uses: actions/checkout@v4
with:
repository: ProvarTesting/provardx-plugins-utils
path: utils
ref: ${{ steps.check_branch.outputs.result == 'true' && env.BRANCH_NAME || 'develop' }}
token: ${{ secrets.PATUTILS }}
- name: Utils build and link
run: |
cd utils
yarn && yarn prepack
yarn link
- name: Install Dependencies
run: yarn
- name: Link utils package
run: yarn link @provartesting/provardx-plugins-utils
- name: Build the project
run: |
sf plugins link .
yarn prepack
- name: MCP smoke test
timeout-minutes: 5
env:
PROVAR_DEV_WHITELIST_KEYS: ${{ secrets.PROVAR_DEV_WHITELIST_KEYS }}
run: node scripts/mcp-smoke.cjs
- name: Check out Regression repo
uses: actions/checkout@v4
with:
repository: ProvarTesting/provar-manager-regression
path: ProvarRegression
ref: PM_Grid_AutomationPack
token: ${{ secrets.PATREGRESSION }}
- name: Change permissions
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
chmod 777 ./bin/run.js
elif [ "$RUNNER_OS" == "macOS" ]; then
chmod 777 ./bin/run.js
fi
shell: bash
- name: Execute NUTS
run: |
sf plugins link .
yarn run test:nuts
- name: Archive NUTS results
if: always()
uses: actions/upload-artifact@v4
with:
name: nuts-report-${{ matrix.os }}
path: mochawesome-report
if-no-files-found: warn