Skip to content

Commit 0b1344d

Browse files
authored
ci: remove selenium grid from CI (#374)
* ci: remove selenium grid from CI * ci: add some permissions for agreements * ci: add .addonmatrix * ci: get Splunk version from meta job * ci: additional permissions to test-report job * ci: assign permissions to a job, not stop
1 parent 4180c37 commit 0b1344d

File tree

5 files changed

+37
-53
lines changed

5 files changed

+37
-53
lines changed

.addonmatrix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--splunkfeatures METRICS_MULTI,PYTHON3

.github/workflows/agreements.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ on:
77

88
jobs:
99
call-workflow-agreements:
10-
uses: splunk/addonfactory-github-workflows/.github/workflows/reusable-agreements.yaml@v1.3
10+
uses: splunk/addonfactory-github-workflows/.github/workflows/reusable-agreements.yaml@v1
11+
permissions:
12+
actions: read
13+
contents: read
14+
pull-requests: write
15+
statuses: read
1116
secrets:
1217
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1318
PERSONAL_ACCESS_TOKEN: ${{ secrets.PAT_CLATOOL }}

.github/workflows/build-test-release.yaml

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
name: build-test-release
21
on:
32
push:
43
branches:
@@ -14,37 +13,40 @@ concurrency:
1413
cancel-in-progress: true
1514

1615
jobs:
16+
meta:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
matrix_supportedSplunk: ${{ steps.matrix.outputs.supportedSplunk }}
20+
steps:
21+
- uses: actions/checkout@v3
22+
- id: matrix
23+
uses: splunk/addonfactory-test-matrix-action@v1
24+
1725
fossa-scan:
1826
continue-on-error: true
1927
runs-on: ubuntu-latest
2028
steps:
2129
- uses: actions/checkout@v3
22-
- name: run fossa analyze and create report
23-
run: |
30+
- run: |
2431
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
2532
fossa analyze --debug
2633
fossa report attribution --format text > /tmp/THIRDPARTY
2734
env:
2835
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
29-
- name: upload THIRDPARTY file
30-
uses: actions/upload-artifact@v3
36+
- uses: actions/upload-artifact@v3
3137
with:
3238
name: THIRDPARTY
3339
path: /tmp/THIRDPARTY
34-
- name: run fossa test
35-
run: |
40+
- run: |
3641
fossa test --debug
3742
env:
3843
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
3944
4045
compliance-copyrights:
41-
name: Compliance Copyright Headers
4246
runs-on: ubuntu-latest
4347
steps:
44-
- name: Checkout
45-
uses: actions/checkout@v3
46-
- name: Check License Header
47-
uses: apache/skywalking-eyes@v0.4.0
48+
- uses: actions/checkout@v3
49+
- uses: apache/skywalking-eyes@v0.4.0
4850

4951
pre-commit:
5052
runs-on: ubuntu-latest
@@ -61,8 +63,7 @@ jobs:
6163
if: github.actor != 'dependabot[bot]'
6264
steps:
6365
- uses: actions/checkout@v3
64-
- name: Semgrep
65-
id: semgrep
66+
- id: semgrep
6667
uses: returntocorp/semgrep-action@v1
6768
with:
6869
publishToken: ${{ secrets.SEMGREP_PUBLISH_TOKEN }}
@@ -139,14 +140,19 @@ jobs:
139140

140141
run-ui-tests:
141142
needs:
143+
- meta
142144
- build
143145
- prerequisites-ui-tests
144146
runs-on: ubuntu-latest
147+
permissions:
148+
id-token: write
149+
contents: read
150+
checks: write
145151
strategy:
146152
fail-fast: false
147153
matrix:
148-
splunk: ["8.2"]
149-
browser: ["chrome", "firefox", "firefox_grid", "chrome_grid"]
154+
splunk: ${{ fromJson(needs.meta.outputs.matrix_supportedSplunk) }}
155+
browser: ["chrome", "firefox"]
150156
test_suit: [
151157
"test_splunk_ta_example_addon_logging",
152158
"test_splunk_ta_example_addon_account",
@@ -180,8 +186,7 @@ jobs:
180186
pip install git+https://github.com/pixelb/crudini
181187
- name: Splunk Testing
182188
run: |
183-
SPLUNK_VERSION=$(crudini --get tests/deps/build/addonfactory_test_matrix_splunk/splunk_matrix.conf "${{ matrix.splunk }}" VERSION)
184-
export SPLUNK_VERSION
189+
export SPLUNK_VERSION=${{ matrix.splunk.version }}
185190
SPLUNK_APP_ID=$(crudini --get tests/deps/splunk-add-on-for-ucc-example/package/default/app.conf id name)
186191
export SPLUNK_APP_ID
187192
SPLUNK_APP_PACKAGE=output/$(ls output/)
@@ -207,10 +212,7 @@ jobs:
207212
docker-compose -f docker-compose-ci.yml build
208213
# Saucelab connection
209214
docker-compose -f docker-compose-ci.yml up -d sauceconnect
210-
211-
# Start selenium grid if needed.
212-
if [[ "$TEST_BROWSER" == *"firefox_grid"* ]]; then docker-compose -f docker-compose-ci.yml up -d firefox-grid; fi
213-
if [[ "$TEST_BROWSER" == *"chrome_grid"* ]]; then docker-compose -f docker-compose-ci.yml up -d chrome-grid; fi
215+
214216
# Start Splunk
215217
docker-compose -f docker-compose-ci.yml up -d splunk
216218
until docker-compose -f docker-compose-ci.yml logs splunk | grep "Ansible playbook complete" ; do sleep 1; done
@@ -236,8 +238,7 @@ jobs:
236238
with:
237239
name: test-results-${{ matrix.splunk }}_${{ matrix.python-version }}_${{ matrix.browser }}_${{ matrix.test_suit }}
238240
path: test-results/*
239-
- name: Test Report
240-
uses: dorny/test-reporter@v1
241+
- uses: dorny/test-reporter@v1
241242
if: always()
242243
with:
243244
name: test-report-${{ matrix.splunk }}_${{ matrix.python-version }}_${{ matrix.browser }}_${{ matrix.test_suit }}
@@ -252,19 +253,15 @@ jobs:
252253
- run-unit-tests
253254
runs-on: ubuntu-latest
254255
steps:
255-
- name: Checkout
256-
uses: actions/checkout@v3
256+
- uses: actions/checkout@v3
257257
with:
258258
submodules: false
259259
persist-credentials: false
260-
- name: Setup python
261-
uses: actions/setup-python@v4
260+
- uses: actions/setup-python@v4
262261
with:
263262
python-version: "3.7"
264-
- name: Install Poetry
265-
run: curl -sSL https://install.python-poetry.org | python3 -
266-
- name: Semantic Release
267-
id: semantic
263+
- run: curl -sSL https://install.python-poetry.org | python3 -
264+
- id: semantic
268265
uses: splunk/semantic-release-action@v1.3
269266
with:
270267
git_committer_name: ${{ secrets.SA_GH_USER_NAME }}
@@ -275,8 +272,7 @@ jobs:
275272
@google/semantic-release-replace-plugin
276273
env:
277274
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }}
278-
- name: Publish to pypi
279-
if: ${{ steps.semantic.outputs.new_release_published == 'true' }}
275+
- if: ${{ steps.semantic.outputs.new_release_published == 'true' }}
280276
uses: splunk/pypi-publish-action@v1.0
281277
with:
282278
pypi_username: ${{ secrets.PYPI_USERNAME }}

.github/workflows/exclude-patterns.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

docker-compose-ci.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,6 @@ services:
112112
ports:
113113
- "4445"
114114

115-
chrome-grid:
116-
image: selenium/standalone-chrome:91.0
117-
shm_size: 2gb
118-
ports:
119-
- "6900:5900"
120-
- "4444"
121-
122-
firefox-grid:
123-
image: selenium/standalone-firefox:90.0
124-
shm_size: 2gb
125-
ports:
126-
- "6901:5900"
127-
- "4444"
128-
129115
volumes:
130116
results:
131117
external: false

0 commit comments

Comments
 (0)