-
Notifications
You must be signed in to change notification settings - Fork 79
70 lines (65 loc) · 2.4 KB
/
test.yml
File metadata and controls
70 lines (65 loc) · 2.4 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
name: tests
on:
push:
branches-ignore: [main]
workflow_dispatch:
jobs:
yarn-lockfile-check:
uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main
# Detect which files have changed to determine what tests to run
changes:
runs-on: ubuntu-latest
outputs:
confidence-changed: ${{ steps.changes.outputs.confidence }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
confidence:
- 'confidence/**'
- 'test/confidence/**'
- 'src/tools/**'
# Since the Windows unit tests take much longer, we run the linux unit tests first and then run the windows unit tests in parallel with NUTs
linux-unit-tests:
needs: yarn-lockfile-check
uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main
windows-unit-tests:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main
# Run the confidence tests after the unit tests
confidence-tests:
needs: [linux-unit-tests, changes]
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.confidence-changed == 'true'}}
env:
SF_MCP_CONFIDENCE_CONSUMER_KEY: ${{ secrets.SF_MCP_CONFIDENCE_CONSUMER_KEY }}
SF_MCP_CONFIDENCE_CONSUMER_SECRET: ${{ secrets.SF_MCP_CONFIDENCE_CONSUMER_SECRET }}
SF_MCP_CONFIDENCE_INSTANCE_URL: ${{ secrets.SF_MCP_CONFIDENCE_INSTANCE_URL }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: yarn
- run: yarn install --frozen-lockfile
# Note: we cannot parallelize confidence tests since we don't have the rate limits to support it
# the test runner has rate limiting built-in to prevent hitting the API limits within that test run
- name: Run confidence tests
run: |
for file in test/confidence/*.yml; do
echo "Running confidence test for $file"
yarn test:confidence --file "$file"
done
# Uncomment to enable NUT testing in Github Actions
# nuts:
# needs: linux-unit-tests
# uses: salesforcecli/github-workflows/.github/workflows/nut.yml@main
# secrets: inherit
# strategy:
# matrix:
# os: [ubuntu-latest, windows-latest]
# fail-fast: false
# with:
# os: ${{ matrix.os }}