-
Notifications
You must be signed in to change notification settings - Fork 132
68 lines (64 loc) · 1.97 KB
/
run-matrix.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
---
# Runs the tests based on the provided files in ci.yml
name: run-matrix
on:
workflow_call:
inputs:
versionsFile:
required: true
type: string
frameworksFile:
required: true
type: string
excludedFile:
required: true
type: string
permissions:
contents: read
jobs:
create-test-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: generate
uses: elastic/oblt-actions/version-framework@v1
with:
versions-file: ${{ inputs.versionsFile }}
frameworks-file: ${{ inputs.frameworksFile }}
excluded-file: ${{ inputs.excludedFile }}
test:
needs:
- create-test-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 20
matrix: ${{ fromJSON(needs.create-test-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: Run BDD tests
run: ./spec/scripts/features.sh ${{ matrix.version }}
- name: Run test
run: ./spec/scripts/spec.sh ${{ matrix.version }} ${{ matrix.framework }}
env:
JUNIT_PREFIX: ${{ matrix.version }}-${{ matrix.framework }}
- if: success() || failure()
id: normalize-junit
uses: actions/github-script@v7
with:
result-encoding: string
script: |
function normalizeName(name) {
return name.replace(/["/:<>|*?\\]/g, '-')
}
const framework = normalizeName('${{ matrix.framework }}')
const version = normalizeName('${{ matrix.version }}')
return `${version}-${framework}`
- if: success() || failure()
name: Upload JUnit Test Results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.normalize-junit.outputs.result }}
path: "**/spec/junit-reports/**/*ruby-agent-junit.xml"