-
Notifications
You must be signed in to change notification settings - Fork 34
194 lines (168 loc) · 5.53 KB
/
test.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
186
187
188
189
190
191
192
193
194
name: Tests
on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
schedule:
- cron: '0 8 * * *'
jobs:
test:
name: Test
if: github.event_name != 'schedule'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
test-args:
- "--features aws-auth"
- "--no-default-features --features rustls-tls --package opensearch --test cert"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Rust Client
uses: actions/checkout@v3
with:
path: client
- name: Setup Rust tools
uses: ./client/.github/actions/setup-rust-tools
- name: Run OpenSearch
id: opensearch
uses: ./client/.github/actions/run-released-opensearch
with:
version: 2.8.0
secured: true
- name: Run Tests (${{ matrix.test-args }})
working-directory: client
run: cargo make test ${{ matrix.test-args }}
env:
OPENSEARCH_URL: ${{ steps.opensearch.outputs.opensearch_url }}
- name: Upload Coverage Data
uses: codecov/codecov-action@v3
with:
files: ./test_results/opensearch.lcov
flags: unit
- name: Save OpenSearch logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: opensearch-${{ matrix.os }}-${{ matrix.test-args }}
path: |
opensearch-*/logs/*
test-yaml:
name: YAML Tests (Released OpenSearch)
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ['1.1.0', '1.2.4', '1.3.4', '2.2.0', '2.4.0', '2.6.0', '2.8.0']
secured: [true, false]
steps:
- name: Checkout Rust Client
uses: actions/checkout@v3
with:
path: client
- name: Setup Rust tools
uses: ./client/.github/actions/setup-rust-tools
- name: Run OpenSearch
id: opensearch
uses: ./client/.github/actions/run-released-opensearch
with:
version: ${{ matrix.version }}
secured: ${{ matrix.secured }}
- name: Run integration tests
working-directory: client
run: cargo make test-yaml
env:
OPENSEARCH_URL: ${{ steps.opensearch.outputs.opensearch_url }}
- uses: codecov/codecov-action@v3
with:
files: ./client/test_results/opensearch.lcov
flags: integration
- name: Save OpenSearch logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: opensearch-logs-${{ matrix.version }}-${{ matrix.secured }}
path: |
opensearch-*/logs/*
test-yaml-unreleased:
name: YAML Tests (Unreleased OpenSearch)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
opensearch_ref: ['1.x', '2.0', '2.x', 'main']
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/[email protected]
if: github.event_name == 'schedule'
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780
- name: Checkout Rust Client
uses: actions/checkout@v3
with:
path: client
- name: Setup Rust tools
uses: ./client/.github/actions/setup-rust-tools
- name: Checkout OpenSearch
uses: actions/checkout@v3
with:
repository: opensearch-project/opensearch
ref: ${{ matrix.opensearch_ref }}
path: opensearch
- name: Get OpenSearch Commit SHA
id: opensearch-git
working-directory: opensearch
shell: bash -eo pipefail {0}
run: echo sha=`git log -1 --format='%H'` >> $GITHUB_OUTPUT
- name: Restore cached OpenSearch
id: cache-restore
uses: actions/cache/restore@v3
with:
path: opensearch-*
key: opensearch-${{ steps.opensearch-git.outputs.sha }}
- name: Build OpenSearch
if: steps.cache-restore.outputs.cache-hit != 'true'
shell: bash -eo pipefail {0}
run: |
pushd ./opensearch
./gradlew :distribution:archives:linux-tar:assemble
popd
tar -xzf ./opensearch/distribution/archives/linux-tar/build/distributions/opensearch-*.tar.gz
- name: Save cached OpenSearch
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: opensearch-*
key: opensearch-${{ steps.opensearch-git.outputs.sha }}
- name: Start OpenSearch
id: opensearch
uses: ./client/.github/actions/start-opensearch
- name: Run integration tests
working-directory: client
run: cargo make test-yaml
env:
OPENSEARCH_URL: ${{ steps.opensearch.outputs.url }}
- uses: codecov/codecov-action@v3
with:
files: ./client/test_results/opensearch.lcov
flags: integration
- name: Save OpenSearch logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: opensearch-logs-${{ matrix.opensearch_ref }}
path: |
opensearch-*/logs/*
- name: Create issue about failure
if: failure() && github.event_name == 'schedule'
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ steps.github_app_token.outputs.token }}
with:
filename: ./client/.github/test-failure-issue-template.md
update_existing: true