Skip to content

Commit 69ab37a

Browse files
committed
NO-JIRA add tests
1 parent c6667a0 commit 69ab37a

File tree

5 files changed

+184
-23
lines changed

5 files changed

+184
-23
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Multi-arch test 9.x
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- "Multi-arch build 9.x"
7+
types:
8+
- completed
9+
push:
10+
schedule:
11+
# Nightly test equivalent (adjust time as needed)
12+
- cron: '0 4 * * *'
13+
workflow_dispatch:
14+
15+
jobs:
16+
multi-arch-test-9x:
17+
name: Test 9.x (${{ matrix.test_name }}, ${{ matrix.architecture }})
18+
permissions:
19+
id-token: write
20+
contents: read
21+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
22+
uses: ./.github/workflows/multi-arch-test-template.yml
23+
strategy:
24+
matrix:
25+
architecture: [amd64, arm64]
26+
include:
27+
- test_name: docker
28+
tag: 9.9.9-master-community
29+
- test_name: docker
30+
tag: 9.9.9-master-developer
31+
- test_name: docker
32+
tag: 9.9.9-master-enterprise
33+
- test_name: docker-compose
34+
tag: 9.9.9-master-datacenter
35+
with:
36+
staging_image_name: sonarsource/sonarqube
37+
tag: ${{ matrix.tag }}
38+
test_name: ${{ matrix.test_name }}
39+
architecture: ${{ matrix.architecture }}
40+
runs_on: ${{ matrix.architecture == 'arm64' && 'ubuntu-latest-large-arm64' || 'ubuntu-latest-large' }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Multi-arch test commercial editions
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- "Multi-arch build commercial editions"
7+
types:
8+
- completed
9+
push:
10+
schedule:
11+
# Nightly test equivalent (adjust time as needed)
12+
- cron: '0 4 * * *'
13+
workflow_dispatch:
14+
15+
jobs:
16+
multi-arch-test-commercial-editions:
17+
name: Test commercial editions (${{ matrix.test_name }}, ${{ matrix.architecture }})
18+
permissions:
19+
id-token: write
20+
contents: read
21+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
22+
uses: ./.github/workflows/multi-arch-test-template.yml
23+
strategy:
24+
matrix:
25+
architecture: [amd64, arm64]
26+
include:
27+
- test_name: docker
28+
tag: 2025.4.1-master-developer
29+
- test_name: docker
30+
tag: 2025.4.1-master-enterprise
31+
- test_name: docker-compose
32+
tag: 2025.4.1-master-datacenter
33+
with:
34+
staging_image_name: sonarsource/sonarqube
35+
tag: ${{ matrix.tag }}
36+
test_name: ${{ matrix.test_name }}
37+
architecture: ${{ matrix.architecture }}
38+
runs_on: ${{ matrix.architecture == 'arm64' && 'ubuntu-latest-large-arm64' || 'ubuntu-latest-large' }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Multi-arch test community build
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- "Multi-arch build community build"
7+
types:
8+
- completed
9+
push:
10+
schedule:
11+
# Nightly test equivalent (adjust time as needed)
12+
- cron: '0 4 * * *'
13+
workflow_dispatch:
14+
15+
jobs:
16+
multi-arch-test-community-build:
17+
name: Test community build (${{ matrix.test_name }}, ${{ matrix.architecture }})
18+
permissions:
19+
id-token: write
20+
contents: read
21+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
22+
uses: ./.github/workflows/multi-arch-test-template.yml
23+
strategy:
24+
matrix:
25+
architecture: [amd64, arm64]
26+
include:
27+
- test_name: docker
28+
tag: 25.7.0.110598-master-community
29+
with:
30+
staging_image_name: sonarsource/sonarqube
31+
tag: ${{ matrix.tag }}
32+
test_name: ${{ matrix.test_name }}
33+
architecture: ${{ matrix.architecture }}
34+
runs_on: ${{ matrix.architecture == 'arm64' && 'ubuntu-latest-large-arm64' || 'ubuntu-latest-large' }}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Multi-arch test template
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
staging_image_name:
7+
required: true
8+
type: string
9+
description: "The staging image name to test"
10+
tag:
11+
required: true
12+
type: string
13+
description: "The tag to test"
14+
test_name:
15+
required: true
16+
type: string
17+
description: "The test type to run (docker or docker-compose)"
18+
architecture:
19+
required: true
20+
type: string
21+
description: "The architecture to test (amd64 or arm64)"
22+
runs_on:
23+
required: false
24+
type: string
25+
description: "The runner to use"
26+
default: "ubuntu-latest-large"
27+
28+
jobs:
29+
multi-arch-test:
30+
name: Test ${{ inputs.architecture }}
31+
runs-on: ${{ inputs.runs_on }}
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- id: secrets
37+
name: Retrieve secrets from Vault
38+
uses: SonarSource/vault-action-wrapper@v3
39+
with:
40+
secrets: |
41+
development/kv/data/docker/sonardockerrw username | docker_username;
42+
development/kv/data/docker/sonardockerrw access_token_rwd | docker_password;
43+
44+
- name: Login to Docker Hub
45+
uses: docker/login-action@v3
46+
with:
47+
username: ${{ fromJSON(steps.secrets.outputs.vault).docker_username }}
48+
password: ${{ fromJSON(steps.secrets.outputs.vault).docker_password }}
49+
50+
- name: Set up system for Elasticsearch
51+
run: |
52+
# Set the recommended memory for ES
53+
sudo sysctl -w vm.max_map_count=524288
54+
# Set the recommended number of opened file descriptors for ES
55+
ulimit -n 131072
56+
57+
- name: Run Docker image tests
58+
env:
59+
STAGING_IMAGE_NAME: ${{ inputs.staging_image_name }}
60+
TAG: ${{ inputs.tag }}
61+
TEST_NAME: ${{ inputs.test_name }}
62+
ARCH: ${{ inputs.architecture }}
63+
run: |
64+
echo "Test the ${STAGING_IMAGE_NAME}:${TAG} image supporting linux/${ARCH}"
65+
./run-tests.sh "${STAGING_IMAGE_NAME}:${TAG}" "${TEST_NAME}"

.github/workflows/private-scan.yml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,22 @@
11
name: Private scan
22

33
on:
4-
push:
5-
# For testing - will change back to workflow_run later
6-
# paths:
7-
# - '9/**/*'
8-
# - 'commercial-editions/**/*'
9-
# - '.cirrus/*'
10-
# - '.github/workflows/private-scan.yml'
11-
pull_request:
12-
# For testing - will change back to workflow_run later
13-
# paths:
14-
# - '9/**/*'
15-
# - 'commercial-editions/**/*'
16-
# - '.cirrus/*'
17-
# - '.github/workflows/private-scan.yml'
4+
workflow_run:
5+
workflows:
6+
- "Multi-arch build 9.x"
7+
- "Multi-arch build commercial editions"
8+
types:
9+
- completed
1810
schedule:
1911
# Nightly scan equivalent (adjust time as needed)
2012
- cron: '0 3 * * *'
2113
workflow_dispatch:
2214

23-
# TODO: Change back to this once workflows are on default branch:
24-
# workflow_run:
25-
# workflows:
26-
# - "Multi-arch build 9.x"
27-
# - "Multi-arch build commercial editions"
28-
# types:
29-
# - completed
30-
3115
jobs:
3216
private-scan:
3317
name: Private scan (${{ matrix.tag }})
3418
runs-on: ubuntu-latest-large
35-
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' || github.event_name == 'pull_request' }}
19+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
3620
permissions:
3721
id-token: write
3822
contents: read

0 commit comments

Comments
 (0)