diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index eac03a5..a5cd6b1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,5 +1,7 @@ -name: build +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +name: build on: push: # run on every new commit pushed to 'main' @@ -8,27 +10,40 @@ on: # run whenever a new tag is created following one of the following patterns tags: - v[0-9]+.[0-9]+.[0-9]+ - concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true - +permissions: {} jobs: conda-python-build: - secrets: inherit + secrets: inherit # zizmor: ignore[secrets-inherit] uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@main with: build_type: branch script: ci/build_python.sh pure-conda: true + permissions: + actions: read + contents: read + id-token: write + packages: read + pull-requests: read upload-conda: needs: [conda-python-build] - secrets: inherit + secrets: + CONDA_RAPIDSAI_NIGHTLY_TOKEN: ${{ secrets.CONDA_RAPIDSAI_NIGHTLY_TOKEN }} + CONDA_RAPIDSAI_TOKEN: ${{ secrets.CONDA_RAPIDSAI_TOKEN }} uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@main with: build_type: branch + permissions: + actions: read + contents: read + id-token: write + packages: read + pull-requests: read wheel-build: - secrets: inherit + secrets: inherit # zizmor: ignore[secrets-inherit] uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main with: build_type: branch @@ -39,11 +54,25 @@ jobs: package-type: python pure-wheel: true append-cuda-suffix: false + permissions: + actions: read + contents: read + id-token: write + packages: read + pull-requests: read wheel-publish: needs: wheel-build - secrets: inherit + secrets: + CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN: ${{ secrets.CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN }} + RAPIDSAI_PYPI_TOKEN: ${{ secrets.RAPIDSAI_PYPI_TOKEN }} uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@main with: build_type: branch package-name: rapids-cli package-type: python + permissions: + actions: read + contents: read + id-token: write + packages: read + pull-requests: read diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 12e67ee..f5a6db9 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,15 +1,16 @@ -name: pr +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +name: pr on: push: branches: - "pull-request/[0-9]+" - # automatically cancel in-progress CI runs if a new commit is pushed to the same ref concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true - +permissions: {} jobs: pr-builder: needs: @@ -18,28 +19,37 @@ jobs: - conda-python-tests - wheel-build - wheel-tests - secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@main if: always() with: needs: ${{ toJSON(needs) }} + permissions: + contents: read checks: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - name: Run pre-commit - uses: pre-commit/action@v3.0.1 + uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 conda-python-build: needs: [checks] - secrets: inherit + secrets: inherit # zizmor: ignore[secrets-inherit] uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@main with: build_type: pull-request script: ci/build_python.sh pure-conda: true + permissions: + actions: read + contents: read + id-token: write + packages: read + pull-requests: read conda-python-tests: needs: [conda-python-build] - secrets: inherit + secrets: inherit # zizmor: ignore[secrets-inherit] uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main with: build_type: pull-request @@ -47,6 +57,12 @@ jobs: arch: "amd64" container_image: "rapidsai/ci-conda:latest" script: ci/test_python.sh + permissions: + actions: read + contents: read + id-token: write + packages: read + pull-requests: read wheel-build: uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main needs: [checks] @@ -59,9 +75,15 @@ jobs: package-type: python pure-wheel: true append-cuda-suffix: false + permissions: + actions: read + contents: read + id-token: write + packages: read + pull-requests: read wheel-tests: needs: [wheel-build] - secrets: inherit + secrets: inherit # zizmor: ignore[secrets-inherit] uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main with: build_type: pull-request @@ -69,3 +91,9 @@ jobs: arch: "amd64" container_image: "rapidsai/citestwheel:latest" script: ci/test_wheel.sh + permissions: + actions: read + contents: read + id-token: write + packages: read + pull-requests: read diff --git a/.github/zizmor.yml b/.github/zizmor.yml new file mode 100644 index 0000000..d879813 --- /dev/null +++ b/.github/zizmor.yml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +rules: + unpinned-uses: + config: + policies: + # We require SHA-pinning for all workflows and actions _except_ for those from + # rapidsai/shared-workflows and rapidsai/shared-actions + "rapidsai/shared-workflows/*": any + "rapidsai/shared-actions/*": any + "*": hash-pin diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b02da22..f563940 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -73,5 +73,9 @@ repos: (?x) [.](py|sh|yaml|yml)$ - id: verify-pyproject-license + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: v1.24.1 + hooks: + - id: zizmor default_language_version: python: python3