-
Notifications
You must be signed in to change notification settings - Fork 26
185 lines (179 loc) · 7.1 KB
/
all-tests.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: All Unit and Integration Tests
on:
push:
pull_request:
types: [assigned, opened, synchronize, reopened, edited]
workflow_dispatch:
inputs:
ref:
description: Branch/tag/hash to use (defaults to master)
required: false
default: master
jobs:
description: Jobs to run (comma-separated, defaults to all)
required: false
jobs:
log-params:
name: Log Params
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- run: echo "Github event inputs [${{ toJson(github.event.inputs) }}]."
- run: echo "Head commit message [${{ github.event.head_commit.message }}]."
# check path to bundled Maven executable; it should be then used in ATLAS_MVN
- run: mvn -version
prepare:
name: Prepare Matrix
runs-on: ubuntu-latest
outputs:
unit-tests-matrix: ${{ steps.set-matrix.outputs.unit-tests-matrix }}
jira-it-matrix: ${{ steps.set-matrix.outputs.jira-it-matrix }}
confluence-it-matrix: ${{ steps.set-matrix.outputs.confluence-it-matrix }}
bitbucket-it-matrix: ${{ steps.set-matrix.outputs.bitbucket-it-matrix }}
# TODO: Remove these flags when new major jira (10.x) is released
skip-jira-its: ${{ steps.set-matrix.outputs.skip-jira-its }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- id: set-matrix
run: bin/build/prepare-matrices.sh
unit-tests:
name: Unit Tests
needs: prepare
runs-on: ubuntu-20.04
# around 800 Mb of dependencies need to be loaded; it may take long first time until it's cached
timeout-minutes: 30
if: "(github.event.inputs.jobs == '' || contains(github.event.inputs.jobs, 'unit-tests')) && !contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.unit-tests-matrix) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: adopt
- run: bin/build/install-plugin-sdk.sh
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- run: bin/build/override-plugin-sdk-maven.sh
- run: bin/build/run-unit-tests.sh
- uses: actions/upload-artifact@v4
with:
name: unit-tests-coverage-java-${{ matrix.java-version }}
path: '**/target/site/jacoco/**'
integration-tests-jira:
name: Jira
runs-on: ubuntu-20.04
timeout-minutes: 30
if: (github.event.inputs.jobs == '' || contains(github.event.inputs.jobs, 'integration-tests-jira')) && !needs.prepare.outputs.skip-jira-its
needs: [prepare, unit-tests]
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.jira-it-matrix) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: adopt
- run: bin/build/install-plugin-sdk.sh
- run: bin/build/override-plugin-sdk-maven.sh
- run: bin/build/install-int-test-libs.sh
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- uses: actions/cache@v4
with:
path: ~/.m2/repository/com/atlassian/jira
key: maven-integration-jira-${{ matrix.jira-version }}
- run: bin/build/install-common-modules.sh
- run: VERSION=${{ matrix.jira-version }} bin/build/run-jira-its.sh
- uses: actions/upload-artifact@v4
if: failure()
with:
name: webdriver-screenshots-jira-${{ matrix.jira-version }}
path: jira-slack-server-integration/jira-slack-server-integration-plugin/target/webdriverTests/**
integration-tests-confluence:
name: Confluence
runs-on: ubuntu-20.04
timeout-minutes: 30
if: github.event.inputs.jobs == '' || contains(github.event.inputs.jobs, 'integration-tests-confluence')
needs: [prepare, unit-tests]
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.confluence-it-matrix) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: adopt
- run: bin/build/install-plugin-sdk.sh
- run: bin/build/override-plugin-sdk-maven.sh
- run: bin/build/install-int-test-libs.sh
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- uses: actions/cache@v4
with:
path: ~/.m2/repository/com/atlassian/confluence
key: maven-integration-confluence-${{ matrix.confluence-version }}
- run: bin/build/install-common-modules.sh
- run: VERSION=${{ matrix.confluence-version }} bin/build/run-confluence-its.sh
- uses: actions/upload-artifact@v4
if: failure()
with:
name: webdriver-screenshots-confluence-${{ matrix.confluence-version }}-java-${{ matrix.java-version }}
path: confluence-slack-server-integration-plugin/target/webdriverTests/**
integration-tests-bitbucket:
name: Bitbucket
runs-on: ubuntu-20.04
timeout-minutes: 30
if: github.event.inputs.jobs == '' || contains(github.event.inputs.jobs, 'integration-tests-bitbucket')
needs: [prepare, unit-tests]
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.bitbucket-it-matrix) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
# Dec 13, 2022
# latest Bitbucket 8.6.1 doesn't support latest git 2.38.1 installed on the Ubuntu 20 image Github provides
# install last supported git - 2.37.4; remove this trick once Bitbucket implements support for latest git
# https://confluence.atlassian.com/bitbucketserver/supported-platforms-776640981.html#Supportedplatforms-dvcsDVCS
- run: bin/build/install-supported-git.sh
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: adopt
- run: bin/build/install-plugin-sdk.sh
- run: bin/build/override-plugin-sdk-maven.sh
- run: bin/build/install-int-test-libs.sh
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-unit
- uses: actions/cache@v4
with:
path: ~/.m2/repository/com/atlassian/bitbucket
key: maven-integration-bitbucket-${{ matrix.bitbucket-version }}
- run: bin/build/install-common-modules.sh
- run: VERSION=${{ matrix.bitbucket-version }} bin/build/run-bitbucket-its.sh
- uses: actions/upload-artifact@v4
if: failure()
with:
name: webdriver-screenshots-bitbucket-${{ matrix.bitbucket-version }}-java-${{ matrix.java-version }}
path: bitbucket-slack-server-integration-plugin/target/webdriverTests/**