-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (123 loc) · 4.09 KB
/
matrix-compat.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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Matrix compat
on:
schedule:
# every night at one
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
create-version-matrix:
runs-on: ubuntu-latest
steps:
- id: mintaka-version
uses: wistefan/[email protected]
with:
include: "MINOR"
repository: fiware/mintaka
token: ${{ secrets.ADMIN_TOKEN }}
- id: orion-version
uses: wistefan/get-releases-by-semver@master
with:
include: "MINOR"
minMinor: "6"
versionField: "TAG-NAME"
repository: fiware/context.Orion-LD
outputs:
mintaka-matrix: ${{ steps.mintaka-version.outputs.releases }}
orion-matrix: ${{ steps.orion-version.outputs.releases }}
test-compatibility:
needs: create-version-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
orion: ${{fromJson(needs.create-version-matrix.outputs.orion-matrix)}}
mintaka: ${{fromJson(needs.create-version-matrix.outputs.mintaka-matrix)}}
steps:
- uses: actions/checkout@v2
- uses: wistefan/check-compatibility@master
id: check-compatibility
continue-on-error: true
with:
componentOne: "orion"
componentTwo: "mintaka"
versionOne: ${{ matrix.orion }}
versionTwo: ${{ matrix.mintaka }}
compatibilityFile: doc/compatibility/compatibility.json
- uses: actions/setup-java@v1
with:
java-version: '17'
java-package: jdk
- uses: actions/checkout@v2
with:
ref: ${{ matrix.mintaka }}
- name: Run tests
id: runTest
if: steps.check-compatibility.outcome == 'failure'
continue-on-error: true
run: mvn clean test
env:
ORION_IMAGE: fiware/orion-ld:${{ matrix.orion }}
- name: Publish success
if: steps.runTest.outcome == 'success'
uses: wistefan/check-compatibility@master
with:
operation: "PERSIST_INFO"
componentOne: "orion"
componentTwo: "mintaka"
versionOne: ${{ matrix.orion }}
versionTwo: ${{ matrix.mintaka }}
compatibilityFile: compatibility.json
compatible: "True"
- name: Publish failure
if: steps.runTest.outcome == 'failure'
uses: wistefan/check-compatibility@master
with:
operation: "PERSIST_INFO"
componentOne: "orion"
componentTwo: "mintaka"
versionOne: ${{ matrix.orion }}
versionTwo: ${{ matrix.mintaka }}
compatibilityFile: compatibility.json
compatible: "False"
- name: Upload report
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.orion }}-${{ matrix.mintaka }}
path: compatibility.json
result-step:
needs: test-compatibility
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: compat-matrix
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- uses: actions/download-artifact@v2
with:
path: results
token: ${{ secrets.ADMIN_TOKEN }}
- id: prepare-results
run: |
jq -s '[.[][0]]' ./results/**/compatibility.json > temp-compat.json
- id: merge
run: |
jq -s '[.[][]]|unique' temp-compat.json doc/compatibility/compatibility.json > merged-compat.json
cp merged-compat.json doc/compatibility/compatibility.json
- uses: wistefan/check-compatibility@master
id: create-markdown
with:
operation: "MARKDOWN"
componentOne: "orion"
componentTwo: "mintaka"
compatibilityFile: doc/compatibility/compatibility.json
markdownOutput: doc/compatibility/compatibility.md
- name: Git commit
# dont fail if nothing is to be commited
continue-on-error: true
run: |
git add .
git commit -m "Update compat-matrix"
git push