Skip to content

Commit b996564

Browse files
hedinasrzgliczgithub-actions[bot]sonar-review-alpha[bot]
authored
BUILD-10993: Migrate SonarJS workflows to sonar-m-docker and sonar-*-public runners (#6730)
Co-authored-by: Michal Zgliczynski <mzglicz@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: zglicz <michal.zgliczynski@sonarsource.com> Co-authored-by: sonar-review-alpha[bot] <266116024+sonar-review-alpha[bot]@users.noreply.github.com>
1 parent 375f7b6 commit b996564

14 files changed

Lines changed: 100 additions & 65 deletions

.github/workflows/LabelEslintPlugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
add_eslint_plugin_label:
1111
name: Add eslint-plugin label to Jira
12-
runs-on: github-ubuntu-latest-s
12+
runs-on: sonar-xs-public
1313
permissions:
1414
id-token: write
1515
pull-requests: read

.github/workflows/PullRequestClosed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
PullRequestMerged_job:
99
name: Pull Request Merged
10-
runs-on: github-ubuntu-latest-s
10+
runs-on: sonar-xs-public
1111
permissions:
1212
id-token: write
1313
pull-requests: read

.github/workflows/PullRequestCreated.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
PullRequestCreated_job:
99
name: Pull Request Created
10-
runs-on: github-ubuntu-latest-s
10+
runs-on: sonar-xs-public
1111
permissions:
1212
id-token: write
1313
# For external PR, ticket should be created manually

.github/workflows/RequestReview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
RequestReview_job:
99
name: Request review
10-
runs-on: github-ubuntu-latest-s
10+
runs-on: sonar-xs-public
1111
permissions:
1212
id-token: write
1313
# For external PR, ticket should be moved manually

.github/workflows/SubmitReview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
SubmitReview_job:
99
name: Submit Review
10-
runs-on: github-ubuntu-latest-s
10+
runs-on: sonar-xs-public
1111
permissions:
1212
id-token: write
1313
pull-requests: read

.github/workflows/build.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ concurrency:
1717

1818
jobs:
1919
setup:
20-
runs-on: github-ubuntu-latest-s
20+
runs-on: sonar-xs-public
2121
name: Setup - Prepare Node.js versions and test hashes
2222
permissions: &read_permissions
2323
id-token: write
@@ -73,7 +73,7 @@ jobs:
7373
echo "Cache month: $MONTH"
7474
7575
get_build_number:
76-
runs-on: github-ubuntu-latest-s
76+
runs-on: sonar-xs-public
7777
name: Get build number
7878
needs: setup
7979
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -85,7 +85,7 @@ jobs:
8585
uses: SonarSource/ci-github-actions/get-build-number@master
8686

8787
populate_npm_cache:
88-
runs-on: github-ubuntu-latest-s
88+
runs-on: sonar-xs-public
8989
name: Populate NPM cache for Linux
9090
needs: setup
9191
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -111,14 +111,16 @@ jobs:
111111
java = "21.0"
112112
maven = "3.9"
113113
node = "24.11.0"
114-
- if: steps.cache.outputs.cache-hit != 'true'
114+
- if: steps.cache.outputs.cache-hit != 'true' && runner.os != 'Windows'
115+
uses: SonarSource/ci-github-actions/config-npm@v1
116+
- if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Windows'
115117
id: secrets
116118
name: Access vault secrets
117119
uses: SonarSource/vault-action-wrapper@v3
118120
with:
119121
secrets: |
120122
development/artifactory/token/${{ github.repository_owner }}-${{ github.event.repository.name }}-private-reader access_token | ARTIFACTORY_ACCESS_TOKEN;
121-
- if: steps.cache.outputs.cache-hit != 'true'
123+
- if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Windows'
122124
name: Configure npm registry
123125
run: |
124126
npm config set //repox.jfrog.io/artifactory/api/npm/:_authToken=${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }}
@@ -136,7 +138,7 @@ jobs:
136138
steps: *populate_npm_cache_steps
137139

138140
sync_rspec:
139-
runs-on: github-ubuntu-latest-s
141+
runs-on: sonar-xs-public
140142
name: Sync RSPEC metadata
141143
needs: [setup, populate_npm_cache]
142144
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -183,7 +185,7 @@ jobs:
183185
retention-days: 1
184186

185187
build:
186-
runs-on: github-ubuntu-latest-s
188+
runs-on: sonar-m-public
187189
name: Build SonarJS on Linux
188190
needs: [setup, get_build_number, populate_npm_cache, sync_rspec]
189191
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -447,7 +449,7 @@ jobs:
447449
npm run test
448450
449451
knip:
450-
runs-on: github-ubuntu-latest-s
452+
runs-on: sonar-xs-public
451453
name: Knip
452454
needs: [setup, populate_npm_cache, sync_rspec]
453455
permissions: *read_permissions
@@ -465,7 +467,7 @@ jobs:
465467
GITHUB_TOKEN: ${{ fromJSON(steps.rspec-secrets.outputs.vault).RSPEC_GITHUB_TOKEN }}
466468

467469
test_js:
468-
runs-on: github-ubuntu-latest-m
470+
runs-on: sonar-m-public
469471
name: Unit tests JavaScript/TypeScript
470472
needs: [setup, populate_npm_cache, sync_rspec]
471473
permissions: *read_permissions
@@ -571,7 +573,7 @@ jobs:
571573
GITHUB_TOKEN: ${{ fromJSON(steps.rspec-secrets.outputs.vault || '{}').RSPEC_GITHUB_TOKEN }}
572574

573575
analyze_primary:
574-
runs-on: github-ubuntu-latest-s
576+
runs-on: sonar-xs-public
575577
name: Analyze in SonarQube NEXT
576578
needs: [setup, test_js, build]
577579
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -630,7 +632,7 @@ jobs:
630632
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.1.0.4751:sonar $SONAR_ARGS
631633
632634
analyze_shadows:
633-
runs-on: github-ubuntu-latest-s
635+
runs-on: sonar-xs-public
634636
name: Analyze in ${{ matrix.platform }}
635637
needs: [setup, test_js, build]
636638
permissions: *read_permissions
@@ -682,7 +684,7 @@ jobs:
682684
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.1.0.4751:sonar $SONAR_ARGS
683685
684686
plugin_qa_with_node:
685-
runs-on: github-ubuntu-latest-s
687+
runs-on: sonar-m-public
686688
name: QA with Node ${{ matrix.node-version }} on Ubuntu
687689
needs: [setup, build]
688690
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -727,7 +729,7 @@ jobs:
727729
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).licenses_token }}
728730

729731
plugin_qa_fast_with_node:
730-
runs-on: github-ubuntu-latest-s
732+
runs-on: sonar-xs-public
731733
name: Fast QA with Node ${{ matrix.node-version }} on Ubuntu
732734
needs: [setup, build]
733735
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -753,7 +755,7 @@ jobs:
753755
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).licenses_token }}
754756

755757
plugin_qa_without_node:
756-
runs-on: github-ubuntu-latest-s
758+
runs-on: sonar-m-public
757759
name: QA without Node on Ubuntu SQ:LATEST_RELEASE
758760
needs: [setup, build]
759761
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -779,16 +781,14 @@ jobs:
779781
shell: bash
780782
run: |
781783
node --version
782-
NODE_PATH=$(which node)
783-
sudo mv "$NODE_PATH" "${NODE_PATH}.disabled"
784784
785-
# Verify node is no longer accessible
786-
if which node 2>/dev/null; then
787-
echo "ERROR: node is still accessible!"
788-
exit 1
789-
else
790-
echo "SUCCESS: node is no longer accessible"
791-
fi
785+
function node() {
786+
echo "node is disabled"
787+
exit 0
788+
}
789+
export -f node
790+
791+
node
792792
- *orchestrator_cache
793793
- name: Run Plugin QA without Node
794794
run: |
@@ -802,7 +802,7 @@ jobs:
802802

803803
# DEV tests run only on nightly schedule to avoid constant downloads
804804
plugin_qa_without_node_dev:
805-
runs-on: github-ubuntu-latest-s
805+
runs-on: sonar-xs-public
806806
name: QA without Node on Ubuntu SQ:DEV
807807
needs: [setup, build]
808808
if: github.event_name == 'schedule'
@@ -827,7 +827,7 @@ jobs:
827827
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).licenses_token }}
828828

829829
plugin_qa_without_node_alpine:
830-
runs-on: github-ubuntu-latest-m
830+
runs-on: sonar-m-docker
831831
name: QA without Node on Alpine SQ:LATEST_RELEASE
832832
needs: [setup, get_build_number, build]
833833
if: github.event_name == 'schedule'
@@ -883,7 +883,7 @@ jobs:
883883
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).licenses_token }}
884884

885885
plugin_qa_fast_without_node:
886-
runs-on: github-ubuntu-latest-s
886+
runs-on: sonar-m-public
887887
name: Fast QA without Node on Ubuntu SQ:LATEST_RELEASE
888888
needs: [setup, build]
889889
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -910,7 +910,7 @@ jobs:
910910

911911
# DEV tests run only on nightly schedule to avoid constant downloads
912912
plugin_qa_fast_without_node_dev:
913-
runs-on: github-ubuntu-latest-s
913+
runs-on: sonar-xs-public
914914
name: Fast QA without Node on Ubuntu SQ:DEV
915915
needs: [setup, build]
916916
if: github.event_name == 'schedule'
@@ -934,7 +934,7 @@ jobs:
934934
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).licenses_token }}
935935

936936
plugin_qa_fast_without_node_alpine:
937-
runs-on: github-ubuntu-latest-m
937+
runs-on: sonar-m-docker
938938
name: Fast QA without Node on Alpine SQ:LATEST_RELEASE
939939
needs: [setup, get_build_number, build]
940940
if: github.event_name == 'schedule'
@@ -1066,7 +1066,7 @@ jobs:
10661066
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).licenses_token }}
10671067

10681068
js_ts_ruling:
1069-
runs-on: github-ubuntu-latest-m
1069+
runs-on: sonar-xl-public
10701070
name: JS/TS Ruling
10711071
needs: [setup, populate_npm_cache, sync_rspec]
10721072
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -1240,7 +1240,7 @@ jobs:
12401240
fi
12411241
12421242
ruling:
1243-
runs-on: github-ubuntu-latest-m
1243+
runs-on: sonar-xl-public
12441244
name: Ruling Test
12451245
needs: [setup, build]
12461246
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false
@@ -1271,7 +1271,7 @@ jobs:
12711271

12721272
# IRIS tasks (nightly only)
12731273
run_iris:
1274-
runs-on: github-ubuntu-latest-s
1274+
runs-on: sonar-xs-public
12751275
name: IRIS SQ NEXT -> ${{ matrix.shadow-name }}
12761276
needs: [analyze_primary, analyze_shadows]
12771277
if: github.event_name == 'schedule'
@@ -1294,7 +1294,7 @@ jobs:
12941294
shadow1_platform: ${{ matrix.shadow-platform }}
12951295

12961296
promote:
1297-
runs-on: github-ubuntu-latest-s
1297+
runs-on: sonar-xs-public
12981298
needs:
12991299
- build
13001300
- build_win
@@ -1325,7 +1325,7 @@ jobs:
13251325
promote-pull-request: true
13261326

13271327
releasability:
1328-
runs-on: github-ubuntu-latest-s
1328+
runs-on: sonar-xs-public
13291329
name: Releasability
13301330
needs:
13311331
- promote

.github/workflows/bump-versions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
jobs:
1717
bump-version:
18-
runs-on: github-ubuntu-latest-s
18+
runs-on: sonar-xs-public
1919
permissions:
2020
contents: write
2121
pull-requests: write

.github/workflows/docker-a3s-repox.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919

2020
jobs:
2121
get_build_number:
22-
runs-on: github-ubuntu-latest-s
22+
runs-on: sonar-m-docker
2323
name: Get build number
2424
permissions:
2525
id-token: write
@@ -32,7 +32,7 @@ jobs:
3232

3333
build_and_publish:
3434
name: Build and publish Docker image
35-
runs-on: github-ubuntu-latest-m
35+
runs-on: sonar-m-docker
3636
needs: get_build_number
3737
permissions:
3838
id-token: write
@@ -52,21 +52,17 @@ jobs:
5252
[tools]
5353
node = "24.11.0"
5454
55+
- uses: SonarSource/ci-github-actions/config-npm@v1
56+
5557
- name: Access vault secrets
5658
id: secrets
5759
uses: SonarSource/vault-action-wrapper@v3
5860
with:
5961
secrets: |
60-
development/artifactory/token/{REPO_OWNER_NAME_DASH}-private-reader access_token | ARTIFACTORY_ACCESS_TOKEN;
6162
development/artifactory/token/{REPO_OWNER_NAME_DASH}-qa-deployer access_token | ARTIFACTORY_DEPLOY_PASSWORD;
6263
development/artifactory/token/{REPO_OWNER_NAME_DASH}-qa-deployer username | ARTIFACTORY_DEPLOY_USERNAME;
6364
development/github/token/{REPO_OWNER_NAME_DASH}-rspec token | RSPEC_GITHUB_TOKEN;
6465
65-
- name: Configure npm registry
66-
run: |
67-
npm config set //repox.jfrog.io/artifactory/api/npm/:_authToken=${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }}
68-
npm config set registry https://repox.jfrog.io/artifactory/api/npm/npm/
69-
7066
- name: Install NPM dependencies
7167
run: npm ci
7268

.github/workflows/docker-a3s.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919

2020
jobs:
2121
get_build_number:
22-
runs-on: github-ubuntu-latest-s
22+
runs-on: sonar-m-docker
2323
name: Get build number
2424
permissions:
2525
id-token: write
@@ -32,7 +32,7 @@ jobs:
3232

3333
build_and_publish:
3434
name: Build and publish Docker image
35-
runs-on: github-ubuntu-latest-m
35+
runs-on: sonar-m-docker
3636
needs: get_build_number
3737
environment: ${{ inputs.environment == 'Prod' && 'Prod' || 'Dev5' }}
3838
permissions:
@@ -53,19 +53,15 @@ jobs:
5353
[tools]
5454
node = "24.11.0"
5555
56+
- uses: SonarSource/ci-github-actions/config-npm@v1
57+
5658
- name: Access vault secrets
5759
id: secrets
5860
uses: SonarSource/vault-action-wrapper@v3
5961
with:
6062
secrets: |
61-
development/artifactory/token/{REPO_OWNER_NAME_DASH}-private-reader access_token | ARTIFACTORY_ACCESS_TOKEN;
6263
development/github/token/{REPO_OWNER_NAME_DASH}-rspec token | RSPEC_GITHUB_TOKEN;
6364
64-
- name: Configure npm registry
65-
run: |
66-
npm config set //repox.jfrog.io/artifactory/api/npm/:_authToken=${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }}
67-
npm config set registry https://repox.jfrog.io/artifactory/api/npm/npm/
68-
6965
- name: Install NPM dependencies
7066
run: npm ci
7167

.github/workflows/dogfood.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
dogfood_merge:
1616
# Run if triggered by push to dogfood/*, or if Build workflow succeeded on master
1717
if: github.event_name == 'push' || github.event.workflow_run.conclusion == 'success'
18-
runs-on: github-ubuntu-latest-s
18+
runs-on: sonar-m-docker
1919
name: Update dogfood branch
2020
permissions:
2121
id-token: write # required for SonarSource/vault-action-wrapper

0 commit comments

Comments
 (0)