Check if VERSION or RAPIDS_VERSION has changed #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | ||
| workflow_call: | ||
| inputs: | ||
| dependency_generator_config_file_path: | ||
| description: "Location of the dependencies.yaml configuration file" | ||
| default: "dependencies.yaml" | ||
| required: false | ||
| type: string | ||
| enable_check_size: | ||
| description: "Whether to enable the size checker" | ||
| default: true | ||
| type: boolean | ||
| required: false | ||
| enable_check_style: | ||
| description: "Whether to enable the style checker" | ||
| default: true | ||
| type: boolean | ||
| required: false | ||
| enable_check_generated_files: | ||
| description: "Whether to enable the generated files checker" | ||
| default: true | ||
| type: boolean | ||
| required: false | ||
| enable_check_pr_job_dependencies: | ||
| description: "Whether to enable the PR workflow dependency checker" | ||
| default: true | ||
| type: boolean | ||
| required: false | ||
| enable_check_version_file_changed: | ||
| description: "Whether to enable the version file changed checker" | ||
| defualt: true | ||
| type: boolean | ||
| required: false | ||
| enable_check_version_against_tag: | ||
| description: "Whether to enable the version tag checker" | ||
| default: true | ||
| type: boolean | ||
| required: false | ||
| ignored_pr_jobs: | ||
| description: "Space separated list of jobs to ignore when checking PR workflow dependencies" | ||
| default: "" | ||
| type: string | ||
| required: false | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| jobs: | ||
| changed-files: | ||
| secrets: inherit | ||
| if: ${{ inputs.enable_check_version_file_changed }} | ||
| uses: ./.github/workflows/changed-files.yaml | ||
| with: | ||
| files_yaml: | | ||
| version_files: | ||
| - VERSION | ||
| - RAPIDS_VERSION | ||
| other-checks: | ||
| runs-on: ubuntu-latest | ||
| needs: changed-files | ||
| container: | ||
| image: rapidsai/ci-conda:25.12-latest # zizmor: ignore[unpinned-images] | ||
| env: | ||
| RAPIDS_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| persist-credentials: true | ||
| - name: Telemetry setup | ||
| uses: rapidsai/shared-actions/telemetry-dispatch-setup@main | ||
| continue-on-error: true | ||
| if: ${{ vars.TELEMETRY_ENABLED == 'true' }} | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| - name: Get PR Info | ||
| id: get-pr-info | ||
| uses: nv-gha-runners/get-pr-info@main | ||
| - name: Run rapids-size-checker | ||
| if: ${{ inputs.enable_check_size }} | ||
| run: rapids-size-checker | ||
| env: | ||
| RAPIDS_BASE_BRANCH: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }} | ||
| - name: Check workflow file dependencies | ||
| if: ${{ inputs.enable_check_pr_job_dependencies }} | ||
| run: rapids-check-pr-job-dependencies "${IGNORED_JOBS}" | ||
| env: | ||
| IGNORED_JOBS: ${{ inputs.ignored_pr_jobs }} | ||
| - name: Check if VERSION or RAPIDS_VERSION file has changed | ||
| if: ${{ inputs.enable_check_version_file_changed }} | ||
| run: | | ||
| if "$VERSION_FILES_CHANGED"; then | ||
| echo "ERROR: VERSION or RAPIDS_VERSION file has been changed" | ||
| exit 1 | ||
| fi | ||
| env: | ||
| VERSION_FILES_CHANGED: ${{ fromJSON(needs.changed-files.outputs.changed_file_groups).version_files }} | ||
| - name: Fetch tags | ||
| if: ${{ inputs.enable_check_version_against_tag }} | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| persist-credentials: false | ||
| fetch-depth: 0 # https://github.com/actions/checkout/issues/1471 | ||
| fetch-tags: true | ||
| - name: Check VERSION file against latest tag | ||
| if: ${{ inputs.enable_check_version_against_tag }} | ||
| run: | | ||
| expected_version="$(python -m dunamai from git --format '{base}')" | ||
| if [ "$expected_version" != "$(cat VERSION)" ]; then | ||
| echo "ERROR: Expected VERSION file to be \"$expected_version\", got:" | ||
| cat VERSION | ||
| exit 1 | ||
| fi | ||
| - name: Telemetry upload attributes | ||
| uses: rapidsai/shared-actions/telemetry-dispatch-stash-job-artifacts@main | ||
| continue-on-error: true | ||
| if: ${{ vars.TELEMETRY_ENABLED == 'true' }} | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| check-style: | ||
| if: ${{ inputs.enable_check_style }} | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: rapidsai/ci-conda:25.12-latest # zizmor: ignore[unpinned-images] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: true | ||
| - name: Telemetry setup | ||
| uses: rapidsai/shared-actions/telemetry-dispatch-setup@main | ||
| continue-on-error: true | ||
| if: ${{ vars.TELEMETRY_ENABLED == 'true' }} | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| - name: Get PR Info | ||
| id: get-pr-info | ||
| uses: nv-gha-runners/get-pr-info@main | ||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pre-commit | ||
| key: pre-commit-0|${{ hashFiles('.pre-commit-config.yaml') }} | ||
| - name: Run ci/check_style.sh | ||
| run: ci/check_style.sh | ||
| env: | ||
| RAPIDS_BASE_BRANCH: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }} | ||
| - name: Telemetry upload attributes | ||
| uses: rapidsai/shared-actions/telemetry-dispatch-stash-job-artifacts@main | ||
| continue-on-error: true | ||
| if: ${{ vars.TELEMETRY_ENABLED == 'true' }} | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||