Skip to content

Commit a1b5504

Browse files
Seppli11joke1196
andauthored
SCANPY-219 Migrate shadow scan and iris tasks to github actions (#264)
Co-authored-by: David Kunzmann <[email protected]>
1 parent e1ca571 commit a1b5504

File tree

3 files changed

+75
-86
lines changed

3 files changed

+75
-86
lines changed

.cirrus.yml

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env:
66
ARTIFACTORY_DEPLOY_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer access_token]
77
ARTIFACTORY_DEPLOY_REPO: sonarsource-pypi-public-qa
88
GITHUB_TOKEN: VAULT[development/github/token/licenses-ro token]
9-
DEPLOY_PULL_REQUEST: 'true'
9+
DEPLOY_PULL_REQUEST: "true"
1010
POETRY_VIRTUALENVS_PATH: "~/.cache/poetry/venvs"
1111
POETRY_CACHE_DIR: "~/.cache/poetry/pypoetry"
1212
SONARQUBE_VERSION: 25.3.0.104237
@@ -17,21 +17,6 @@ env:
1717

1818
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_TAG == "" && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH =~ "branch-.*")
1919

20-
linux_container_definition: &LINUX_CONTAINER_DEFINITION
21-
eks_container:
22-
dockerfile: .cirrus/poetry.Dockerfile
23-
cluster_name: ${CIRRUS_CLUSTER_NAME}
24-
region: eu-central-1
25-
namespace: default
26-
builder_role: cirrus-builder
27-
builder_image: docker-builder-v*
28-
builder_instance_type: t3.small
29-
use_in_memory_disk: true
30-
docker_arguments:
31-
CIRRUS_AWS_ACCOUNT: ${CIRRUS_AWS_ACCOUNT}
32-
cpu: 3
33-
memory: 8G
34-
3520
.jfrog_config_template: &JFROG_CONFIG_TEMPLATE
3621
jfrog_config_script:
3722
- $JF_ALIAS config add repox --artifactory-url "$ARTIFACTORY_URL" --access-token "$ARTIFACTORY_PRIVATE_ACCESS_TOKEN"
@@ -43,12 +28,6 @@ poetry_cache_template: &POETRY_CACHE
4328
folder: ~/.cache/poetry/
4429
fingerprint_script: cat poetry.lock
4530

46-
.poetry_install_template: &POETRY_INSTALL
47-
<<: *POETRY_CACHE
48-
<<: *JFROG_CONFIG_TEMPLATE
49-
poetry_install_script:
50-
- poetry install
51-
5231
.poetry_macos_template: &POETRY_MACOS_TEMPLATE
5332
<<: *POETRY_CACHE
5433
jfrog_install_script:
@@ -103,21 +82,3 @@ its_macos_task:
10382
fingerprint_script: echo "sonarqube-$SONARQUBE_VERSION"
10483
its_script:
10584
- .cirrus/run_its.sh
106-
107-
run_iris_task:
108-
<<: *LINUX_CONTAINER_DEFINITION
109-
# only executed in CRON job AND on master branch
110-
only_if: $CIRRUS_CRON == $CRON_NIGHTLY_JOB_NAME && $CIRRUS_BRANCH == "master"
111-
env:
112-
SONAR_SOURCE_IRIS_TOKEN: VAULT[development/kv/data/iris data.next]
113-
matrix:
114-
- name: "IRIS SQ NEXT -> Sonarcloud.io"
115-
env:
116-
SONAR_TARGET_URL: https://sonarcloud.io
117-
SONAR_TARGET_IRIS_TOKEN: VAULT[development/kv/data/iris data.sqc-eu]
118-
- name: "IRIS SQ NEXT -> SonarQube.us"
119-
env:
120-
SONAR_TARGET_URL: https://sonarqube.us
121-
SONAR_TARGET_IRIS_TOKEN: VAULT[development/kv/data/iris data.sqc-us]
122-
script:
123-
- .cirrus/run_iris.sh

.cirrus/run_iris.sh

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

.github/workflows/Iris.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Iris sync
2+
on:
3+
schedule:
4+
- cron: "0 2 * * *"
5+
workflow_dispatch:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
coverage:
13+
name: "Coverage report generation"
14+
runs-on: github-ubuntu-latest-s
15+
permissions:
16+
id-token: write
17+
contents: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
21+
- name: Configure poetry
22+
uses: ./.github/actions/config-poetry
23+
- run: |
24+
poetry run pytest --cov-report=xml:coverage.xml --cov-config=pyproject.toml --cov=src --cov-branch tests
25+
poetry run mypy src/ > mypy-report.txt || true
26+
- name: Upload coverage artifacts
27+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
28+
with:
29+
name: coverage-reports
30+
path: |
31+
coverage.xml
32+
mypy-report.txt
33+
34+
shadow-scans:
35+
name: Shadow Scans
36+
needs: coverage
37+
runs-on: github-ubuntu-latest-s
38+
permissions:
39+
id-token: write
40+
contents: write
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
44+
45+
- name: Download coverage artifacts
46+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
47+
with:
48+
name: coverage-reports
49+
50+
- name: Build and run shadow scan
51+
uses: SonarSource/ci-github-actions/build-poetry@v1
52+
with:
53+
sonar-platform: next
54+
run-shadow-scans: true
55+
artifactory-reader-role: private-reader
56+
artifactory-deployer-role: qa-deployer
57+
58+
iris:
59+
name: IRIS Sync
60+
needs: shadow-scans
61+
runs-on: github-ubuntu-latest-s
62+
permissions:
63+
id-token: write
64+
contents: write
65+
steps:
66+
- name: Run IRIS Analysis
67+
uses: SonarSource/unified-dogfooding-actions/run-iris@v1
68+
with:
69+
primary_project_key: "SonarSource_sonar-scanner-python"
70+
primary_platform: "Next"
71+
shadow1_project_key: "SonarSource_sonar-scanner-python"
72+
shadow1_platform: "SQC-EU"
73+
shadow2_project_key: "SonarSource_sonar-scanner-python"
74+
shadow2_platform: "SQC-US"

0 commit comments

Comments
 (0)