Skip to content

Commit

Permalink
fix: move ORT from actions to relevant workflows (#113)
Browse files Browse the repository at this point in the history
* fix: move ORT from actions to relevant workflows

* chore: fixate ORT version

* chore: remove string to boolean hack

* chore: update self dependencies

* feat: add ort_version input variable

---------

Co-authored-by: Vladislav Yatsun <[email protected]>
  • Loading branch information
tataranovich and nepalevov authored Nov 18, 2024
1 parent c32ebe4 commit 4617dbb
Show file tree
Hide file tree
Showing 16 changed files with 137 additions and 83 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/generic_docker_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
type: boolean
default: false
description: Do not fail pipeline if ORT scan failed
ort_version:
type: string
default: "latest"
description: ORT version to use
enable_trivy:
type: boolean
default: true
Expand All @@ -44,14 +48,15 @@ jobs:
bypass_style_checks: ${{ inputs.bypass_style_checks }}
enable_ort: ${{ inputs.enable_ort }}
bypass_ort: ${{ inputs.bypass_ort }}
ort_version: ${{ inputs.ort_version }}

docker_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
image_name: ghcr.io/${{ env.IMAGE_NAME }}
image_tag: test
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/generic_docker_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ on:
type: boolean
default: false
description: Do not fail pipeline if ORT scan failed
ort_version:
type: string
default: "latest"
description: ORT version to use
enable_trivy:
type: boolean
default: true
Expand All @@ -52,6 +56,7 @@ jobs:
bypass_style_checks: ${{ inputs.bypass_style_checks }}
enable_ort: ${{ inputs.enable_ort }}
bypass_ort: ${{ inputs.bypass_ort }}
ort_version: ${{ inputs.ort_version }}

calculate_version:
runs-on: ubuntu-latest
Expand All @@ -60,7 +65,7 @@ jobs:
is_latest: ${{ steps.semantic_versioning.outputs.is_latest }}
latest_tag: ${{ steps.semantic_versioning.outputs.latest_tag }}
steps:
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
id: semantic_versioning

release:
Expand All @@ -73,14 +78,14 @@ jobs:
- calculate_version
- test
steps:
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
latest_tag: ${{ needs.calculate_version.outputs.latest_tag }}
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
ghcr_username: ${{ github.actor }}
ghcr_password: ${{ secrets.ACTIONS_BOT_TOKEN }}
Expand All @@ -97,7 +102,7 @@ jobs:
${{ github.ref == 'refs/heads/development' && format('{0}/{1}:{2}', 'ghcr.io', env.IMAGE_NAME, 'development') || ''}}
${{ startsWith(github.ref, 'refs/heads/release-') && needs.calculate_version.outputs.is_latest == 'true' && format('{0}:{1}', env.IMAGE_NAME, 'latest') || ''}}
${{ startsWith(github.ref, 'refs/heads/release-') && needs.calculate_version.outputs.is_latest == 'true' && format('{0}/{1}:{2}', 'ghcr.io', env.IMAGE_NAME, 'latest') || ''}}
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
tag_version: ${{ needs.calculate_version.outputs.next_version }}
changelog_file: "/tmp/my_changelog" # comes from generate_release_notes step; TODO: beautify
12 changes: 10 additions & 2 deletions .github/workflows/generic_docker_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
type: boolean
default: false
description: Do not fail pipeline if ORT scan failed
ort_version:
type: string
default: "latest"
description: ORT version to use

jobs:
style_checks:
Expand All @@ -45,6 +49,10 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/ort@1.9.4
- uses: oss-review-toolkit/ort-ci-github-action@9acdf1e56f1b42972b12274ae56c35bf70a5f65b # v1.0.1
with:
bypass_checks: ${{ inputs.bypass_checks || inputs.bypass_ort }}
image: "ghcr.io/oss-review-toolkit/ort:${{ inputs.ort_version }}"
allow-dynamic-versions: "true"
fail-on: "violations"
ort-cli-args: "-P ort.forceOverwrite=true --stacktrace"
continue-on-error: ${{ inputs.bypass_checks || inputs.bypass_ort }}
9 changes: 7 additions & 2 deletions .github/workflows/java_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ on:
type: boolean
default: false
description: Do not fail pipeline if ORT scan failed
ort_version:
type: string
default: "latest"
description: ORT version to use
enable_trivy:
type: boolean
default: true
Expand Down Expand Up @@ -62,6 +66,7 @@ jobs:
bypass_code_checks: ${{ inputs.bypass_code_checks }}
enable_ort: ${{ inputs.enable_ort }}
bypass_ort: ${{ inputs.bypass_ort }}
ort_version: ${{ inputs.ort_version }}
java_version: ${{ inputs.java_version }}
java_distribution: ${{ inputs.java_distribution }}

Expand All @@ -71,7 +76,7 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
java_version: ${{ inputs.java_version }}
java_distribution: ${{ inputs.java_distribution }}
Expand All @@ -83,7 +88,7 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
image_name: ghcr.io/${{ env.IMAGE_NAME }}
image_tag: test
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/java_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ on:
type: boolean
default: false
description: Do not fail pipeline if ORT scan failed
ort_version:
type: string
default: "latest"
description: ORT version to use
enable_trivy:
type: boolean
default: true
Expand Down Expand Up @@ -62,6 +66,7 @@ jobs:
bypass_code_checks: ${{ inputs.bypass_code_checks }}
enable_ort: ${{ inputs.enable_ort }}
bypass_ort: ${{ inputs.bypass_ort }}
ort_version: ${{ inputs.ort_version }}
java_version: ${{ inputs.java_version }}
java_distribution: ${{ inputs.java_distribution }}

Expand All @@ -72,7 +77,7 @@ jobs:
is_latest: ${{ steps.semantic_versioning.outputs.is_latest }}
latest_tag: ${{ steps.semantic_versioning.outputs.latest_tag }}
steps:
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
id: semantic_versioning

release:
Expand All @@ -85,22 +90,22 @@ jobs:
- calculate_version
- test
steps:
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
latest_tag: ${{ needs.calculate_version.outputs.latest_tag }}
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
java_version: ${{ inputs.java_version }}
java_distribution: ${{ inputs.java_distribution }}
- name: Set version
shell: bash
run: |
sed -i -E "s/^([ \t]*version[ \t]*=[ \t]*)[\"'].*[\"']/\1\"${{ needs.calculate_version.outputs.next_version }}\"/g" build.gradle
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
ghcr_username: ${{ github.actor }}
ghcr_password: ${{ secrets.ACTIONS_BOT_TOKEN }}
Expand All @@ -117,7 +122,7 @@ jobs:
${{ github.ref == 'refs/heads/development' && format('{0}/{1}:{2}', 'ghcr.io', env.IMAGE_NAME, 'development') || ''}}
${{ startsWith(github.ref, 'refs/heads/release-') && needs.calculate_version.outputs.is_latest == 'true' && format('{0}:{1}', env.IMAGE_NAME, 'latest') || ''}}
${{ startsWith(github.ref, 'refs/heads/release-') && needs.calculate_version.outputs.is_latest == 'true' && format('{0}/{1}:{2}', 'ghcr.io', env.IMAGE_NAME, 'latest') || ''}}
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
tag_version: ${{ needs.calculate_version.outputs.next_version }}
changelog_file: "/tmp/my_changelog" # comes from generate_release_notes step; TODO: beautify
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/java_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ on:
type: boolean
default: false
description: Do not fail pipeline if ORT scan failed
ort_version:
type: string
default: "latest"
description: ORT version to use
java_version:
type: string
default: "17"
Expand All @@ -48,7 +52,7 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
java_version: ${{ inputs.java_version }}
java_distribution: ${{ inputs.java_distribution }}
Expand All @@ -65,7 +69,7 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
java_version: ${{ inputs.java_version }}
java_distribution: ${{ inputs.java_distribution }}
Expand All @@ -82,7 +86,10 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/ort@1.9.4
- uses: oss-review-toolkit/ort-ci-github-action@9acdf1e56f1b42972b12274ae56c35bf70a5f65b # v1.0.1
with:
bypass_checks: ${{ inputs.bypass_checks || inputs.bypass_ort }}
cli_args: "-P ort.forceOverwrite=true --stacktrace -P ort.analyzer.enabledPackageManagers=Gradle"
image: "ghcr.io/oss-review-toolkit/ort:${{ inputs.ort_version }}"
allow-dynamic-versions: "true"
fail-on: "violations"
ort-cli-args: "-P ort.forceOverwrite=true --stacktrace -P ort.analyzer.enabledPackageManagers=Gradle"
continue-on-error: ${{ inputs.bypass_checks || inputs.bypass_ort }}
7 changes: 6 additions & 1 deletion .github/workflows/node_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ on:
type: boolean
default: false
description: Do not fail pipeline if ORT scan failed
ort_version:
type: string
default: "latest"
description: ORT version to use
enable_trivy:
type: boolean
default: true
Expand Down Expand Up @@ -68,6 +72,7 @@ jobs:
bypass_code_checks: ${{ inputs.bypass_code_checks }}
enable_ort: ${{ inputs.enable_ort }}
bypass_ort: ${{ inputs.bypass_ort }}
ort_version: ${{ inputs.ort_version }}
node_version: ${{ inputs.node_version }}

docker_build:
Expand All @@ -76,7 +81,7 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
image_name: ghcr.io/${{ env.IMAGE_NAME }}
image_tag: test
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/node_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ on:
type: boolean
default: false
description: Do not fail pipeline if ORT scan failed
ort_version:
type: string
default: "latest"
description: ORT version to use
enable_trivy:
type: boolean
default: true
Expand Down Expand Up @@ -72,6 +76,7 @@ jobs:
bypass_code_checks: ${{ inputs.bypass_code_checks }}
enable_ort: ${{ inputs.enable_ort }}
bypass_ort: ${{ inputs.bypass_ort }}
ort_version: ${{ inputs.ort_version }}
node_version: ${{ inputs.node_version }}

calculate_version:
Expand All @@ -81,7 +86,7 @@ jobs:
is_latest: ${{ steps.semantic_versioning.outputs.is_latest }}
latest_tag: ${{ steps.semantic_versioning.outputs.latest_tag }}
steps:
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
id: semantic_versioning

release:
Expand All @@ -94,14 +99,14 @@ jobs:
- calculate_version
- test
steps:
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
latest_tag: ${{ needs.calculate_version.outputs.latest_tag }}
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
node_version: ${{ inputs.node_version }}
clean_install: true
Expand All @@ -110,7 +115,7 @@ jobs:
shell: bash
run: |
npm version ${{ needs.calculate_version.outputs.next_version }} --no-git-tag-version || true # upstream branch may already be updated
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
ghcr_username: ${{ github.actor }}
ghcr_password: ${{ secrets.ACTIONS_BOT_TOKEN }}
Expand Down Expand Up @@ -150,7 +155,7 @@ jobs:
IS_LATEST: ${{ needs.calculate_version.outputs.is_latest == 'true' }}
IS_DEVELOPMENT_BRANCH: ${{ github.ref == 'refs/heads/development' }}
IS_RELEASE_BRANCH: ${{ startsWith(github.ref, 'refs/heads/release-') }}
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
tag_version: ${{ needs.calculate_version.outputs.next_version }}
changelog_file: "/tmp/my_changelog" # comes from generate_release_notes step; TODO: beautify
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/node_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ on:
type: boolean
default: false
description: Do not fail pipeline if ORT scan failed
ort_version:
type: string
default: "latest"
description: ORT version to use
node_version:
type: string
default: "20"
Expand All @@ -52,7 +56,7 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
node_version: ${{ inputs.node_version }}
clean_install: "true"
Expand All @@ -69,7 +73,7 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
node_version: ${{ inputs.node_version }}
clean_install: "true"
Expand All @@ -86,7 +90,7 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/[email protected].4
- uses: epam/ai-dial-ci/actions/[email protected].5
with:
node_version: ${{ inputs.node_version }}
clean_install: "true"
Expand All @@ -103,7 +107,10 @@ jobs:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
lfs: true
- uses: epam/ai-dial-ci/actions/ort@1.9.4
- uses: oss-review-toolkit/ort-ci-github-action@9acdf1e56f1b42972b12274ae56c35bf70a5f65b # v1.0.1
with:
bypass_checks: ${{ inputs.bypass_checks || inputs.bypass_ort }}
cli_args: "-P ort.forceOverwrite=true --stacktrace -P ort.analyzer.enabledPackageManagers=NPM"
image: "ghcr.io/oss-review-toolkit/ort:${{ inputs.ort_version }}"
allow-dynamic-versions: "true"
fail-on: "violations"
ort-cli-args: "-P ort.forceOverwrite=true --stacktrace -P ort.analyzer.enabledPackageManagers=NPM"
continue-on-error: ${{ inputs.bypass_checks || inputs.bypass_ort }}
Loading

0 comments on commit 4617dbb

Please sign in to comment.