Skip to content

Commit

Permalink
Merge pull request #35 from amosproj/merge-core-repo-to-our-fork
Browse files Browse the repository at this point in the history
Merge core repo to our fork
  • Loading branch information
dh1542 authored Nov 5, 2024
2 parents 0a66fcf + 42adb8d commit 51bbce6
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 170 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,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 }}
27 changes: 13 additions & 14 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,7 +93,6 @@ 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
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

0 comments on commit 51bbce6

Please sign in to comment.