Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
job_build_python_whl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v2
Expand Down Expand Up @@ -96,10 +96,10 @@ jobs:
env:
PYTHONPATH: home/runner/work/core/
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.11

Expand Down
94 changes: 47 additions & 47 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Sonarcloud Scan'
name: "Sonarcloud Scan"

run-name: ${{ github.event.workflow_run.display_title }}

Expand All @@ -27,53 +27,53 @@ on:

jobs:
job_download_pr_artifact:
outputs:
pr_info: ${{ steps.pr.outputs.result }}
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: 'Download Artifact'
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr_number"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_number.zip`, Buffer.from(download.data));
outputs:
pr_info: ${{ steps.pr.outputs.result }}
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: "Download Artifact"
uses: actions/github-script@v7
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr_number"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_number.zip`, Buffer.from(download.data));

- name: 'Unzip Artifact'
run: unzip pr_number.zip
- name: "Unzip Artifact"
run: unzip pr_number.zip

- name: 'Read Artifact'
id: pr
uses: actions/github-script@v6
with:
script: |
let fs = require('fs');
return fs.readFileSync('./pr_number');
result-encoding: string
- name: "Read Artifact"
id: pr
uses: actions/github-script@v7
with:
script: |
let fs = require('fs');
return fs.readFileSync('./pr_number');
result-encoding: string

job_run_unit_tests_and_sonarqube:
needs: job_download_pr_artifact
uses: rtdip/core/.github/workflows/sonarcloud_reusable.yml@develop
with:
REPO_NAME: ${{ github.event.workflow_run.head_repository.full_name }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
PR_NUMBER: ${{ fromJSON(needs.job_download_pr_artifact.outputs.pr_info).pr_number }}
PR_HEAD_REF: ${{ fromJSON(needs.job_download_pr_artifact.outputs.pr_info).pr_head_ref }}
PR_BASE_REF: ${{ fromJSON(needs.job_download_pr_artifact.outputs.pr_info).pr_base_ref }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
needs: job_download_pr_artifact
uses: rtdip/core/.github/workflows/sonarcloud_reusable.yml@develop
with:
REPO_NAME: ${{ github.event.workflow_run.head_repository.full_name }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
PR_NUMBER: ${{ fromJSON(needs.job_download_pr_artifact.outputs.pr_info).pr_number }}
PR_HEAD_REF: ${{ fromJSON(needs.job_download_pr_artifact.outputs.pr_info).pr_head_ref }}
PR_BASE_REF: ${{ fromJSON(needs.job_download_pr_artifact.outputs.pr_info).pr_base_ref }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
29 changes: 14 additions & 15 deletions .github/workflows/sonarcloud_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Reusable Sonarcloud Scan'
name: "Reusable Sonarcloud Scan"

on:
workflow_call:
Expand All @@ -25,20 +25,20 @@ on:
type: string
HEAD_SHA:
required: true
type: string
type: string
PR_NUMBER:
required: true
type: string
type: string
PR_HEAD_REF:
required: true
type: string
PR_BASE_REF:
required: true
type: string
type: string
secrets:
SONAR_TOKEN:
required: true

jobs:
job_test_python_pyspark_latest_version:
defaults:
Expand All @@ -48,21 +48,21 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
pyspark: ["3.5.1"]
pyspark: ["3.5.3"]
delta-spark: ["3.0.0"]
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: ${{ inputs.REPO_NAME }}
ref: ${{ inputs.HEAD_BRANCH }}
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Boost
run: |
sudo apt update
Expand All @@ -80,7 +80,7 @@ jobs:
create-args: >-
python=${{ matrix.python-version }}
pyspark=${{ matrix.pyspark }}
delta-spark=${{ matrix.delta-spark }}
delta-spark=${{ matrix.delta-spark }}
cache-environment: true

- name: Test
Expand All @@ -93,12 +93,11 @@ jobs:
coverage xml --omit "venv/**,maintenance/**,xunit-reports/**" -i -o coverage-reports/coverage-unittests.xml
echo Coverage `coverage report --omit "venv/**" | grep TOTAL | tr -s ' ' | cut -d" " -f4`


- name: Mkdocs Test
run: |
mkdocs build --strict

- name: Override Coverage Source Path for Sonar
- name: Override Coverage Source Path for Sonar
run: |
sed -i "s/<source>\/home\/runner\/work\/core\/core<\/source>/<source>\/github\/workspace<\/source>/g" /home/runner/work/core/core/coverage-reports/coverage-unittests.xml

Expand All @@ -115,5 +114,5 @@ jobs:
-Dsonar.pullrequest.branch=${{ inputs.PR_HEAD_REF }}
-Dsonar.pullrequest.base=${{ inputs.PR_BASE_REF }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Loading
Loading