Skip to content
Open
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
6 changes: 4 additions & 2 deletions .github/actions/artifact_failure/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ runs:
steps:
- name: pack failure artifacts
shell: bash
env:
INPUTS_NAME: ${{ inputs.name }}
run: |
echo "Current running processes"
ps uax
Expand All @@ -23,8 +25,8 @@ runs:
--exclude='docs' \
--exclude='bins' \
--exclude='.git' \
-zcf target/failure-${{ inputs.name }}.tar.gz .
- uses: actions/upload-artifact@v4
-zcf target/failure-${INPUTS_NAME}.tar.gz .
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependabot knows how to read these commit SHAs and will update the comments with versions too.

Example: https://github.com/lightgbm-org/LightGBM/pull/7329/changes

with:
name: ${{ inputs.name }}
path: target/failure-${{ inputs.name }}.tar.gz
8 changes: 6 additions & 2 deletions .github/actions/nvcc-toolchain/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ runs:
steps:
- if: runner.os == 'Linux'
shell: bash
run: .github/actions/nvcc-toolchain/install-cuda.sh ${{ inputs.cuda-version }}
env:
INPUTS_NAME: ${{ inputs.name }}
run: .github/actions/nvcc-toolchain/install-cuda.sh ${INPUTS_NAME}

- if: runner.os == 'Windows'
shell: powershell
run: .\.github\actions\nvcc-toolchain\install-cuda.ps1 -cudaVersion ${{ inputs.cuda-version }}
env:
INPUTS_CUDA_VERSION: ${{ inputs.cuda-version }}
run: .\.github\actions\nvcc-toolchain\install-cuda.ps1 -cudaVersion ${INPUTS_CUDA_VERSION}
14 changes: 11 additions & 3 deletions .github/actions/rust-toolchain/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@ runs:
using: composite
steps:
- shell: bash
env:
INPUTS_COMPONENTS: ${{ inputs.components }}
INPUTS_TARGET: ${{ inputs.target }}
INPUTS_TOOLCHAIN: ${{ inputs.toolchain }}
run: |
set -x
rustup override set ${{ inputs.toolchain || 'stable' }}
${{ inputs.target && format('rustup target add {0}', inputs.target) }}
${{ inputs.components && format('rustup component add {0}', inputs.components) }}
rustup override set "${INPUTS_TOOLCHAIN:-stable}"
if [[ -n "${INPUTS_TARGET}" ]]; then
rustup target add ${INPUTS_TARGET}
fi
if [[ -n "${INPUTS_COMPONENTS}" ]]; then
rustup component add ${INPUTS_COMPONENTS}
fi
cargo --version
rustc --version
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ updates:
schedule:
interval: weekly
open-pull-requests-limit: 8
cooldown:
default-days: 7

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose this value arbitrarily.

And value > 0 will be sufficient to slow the spread of problematic packages in the event of a supply chain attack.

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 5
cooldown:
default-days: 7
8 changes: 4 additions & 4 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
- simulation
- memory
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@stable # zizmor: ignore[unpinned-uses]

- uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1

- name: Install cargo-codspeed
shell: bash
Expand All @@ -43,7 +43,7 @@ jobs:
run: cargo codspeed build

- name: Run benchmarks
uses: CodSpeedHQ/action@v4
uses: CodSpeedHQ/action@a4a36bb07c0638b0b4ca52bf1f3dad1b4289e52f # v4.18.1
env:
CODSPEED_LOG: debug
with:
Expand Down
43 changes: 31 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: ci
on: [ push, pull_request ]

permissions:
contents: read

jobs:
lint:
name: ${{ matrix.component }} ${{ matrix.os }}
Expand All @@ -19,7 +22,9 @@ jobs:
cargo_cmd: clippy --locked --all-targets -- -D warnings -A unknown-lints -A clippy::type_complexity -A clippy::new-without-default
steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Install rust
uses: ./.github/actions/rust-toolchain
Expand All @@ -42,7 +47,9 @@ jobs:
feature: [ azure, gcs, gha, memcached, redis, s3, webdav ]
steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Check feature ${{ matrix.feature }}
run: cargo check --no-default-features --features ${{ matrix.feature }}
Expand All @@ -51,7 +58,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Check
run: npx --yes @taplo/cli fmt --check
Expand Down Expand Up @@ -130,10 +139,12 @@ jobs:
CARGO_PROFILE_DEV_DEBUG: '0' # save disk space
steps:
- if: ${{ contains(matrix.os, 'windows') }}
uses: ilammy/msvc-dev-cmd@v1
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci.yml didn't run because of this change.

The action ilammy/msvc-dev-cmd@0b201ec is not allowed in mozilla/sccache because all actions must be from a repository owned by your enterprise, created by GitHub, or match one of the patterns: ...

https://github.com/mozilla/sccache/actions/runs/28532952024

It doesn't show in that output, but I suspect you have a rule like ilammy/msvc-dev-cmd@v1 or similar in the repo (organization-wide) allowlist for third-party actions.

If you like the direction of this PR, then the choices for that list are:

  • use permissive ranges (ilammy/msvc-dev-cmd@*)
  • use commit SHAs (ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756) and update it manually whenever you want to bump versions of actions


- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Install rust
uses: ./.github/actions/rust-toolchain
Expand Down Expand Up @@ -234,7 +245,7 @@ jobs:

- name: Upload coverage results (to Codecov.io)
if: ${{ ! matrix.no_coverage }}
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
with:
files: ${{ steps.coverage.outputs.report }}
## flags: IntegrationTests, UnitTests, ${{ steps.vars.outputs.CODECOV_FLAGS }}
Expand Down Expand Up @@ -306,7 +317,9 @@ jobs:
rustflags: -Ctarget-feature=+crt-static
steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Install rust
uses: ./.github/actions/rust-toolchain
Expand Down Expand Up @@ -374,7 +387,7 @@ jobs:
ID: ${{ startsWith(github.ref, 'refs/tags/') && github.ref || github.sha }}

- name: Upload artifacts
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.binary || 'sccache' }}-${{ steps.id.outputs.id }}-${{ matrix.target }}
path: target/${{ matrix.target }}/release/${{ matrix.binary || 'sccache' }}${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }}
Expand All @@ -391,9 +404,11 @@ jobs:
job:
- { os: ubuntu-22.04 }
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false
- name: Prepare, build and test
uses: vmactions/freebsd-vm@v1
uses: vmactions/freebsd-vm@5a72679103d223925653750faa878a143340fbd0 # v1.5.0
with:
mem: 8192
usesh: true
Expand Down Expand Up @@ -448,9 +463,13 @@ jobs:
runs-on: ubuntu-latest
needs: [ build, lint, test ]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
permissions:
contents: write

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This release job needs elevated permissions for this:

hub release create -d -m $tag_name $tag_name $files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

This is one thing I've really liked about zizmor in other projects... it encourages you to make such things explicit and scope them down narrowly.

All other jobs in this workflow should be able to work with just contents: read, this one needs contents: write.

steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Check versions
run: |
Expand All @@ -463,7 +482,7 @@ jobs:
fi

- name: Get artifacts
uses: actions/download-artifact@v8
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1

- name: Create release assets
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/close-snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
types: [closed]

permissions:
contents: read

jobs:
close:
runs-on: ubuntu-latest
Expand All @@ -12,7 +15,7 @@ jobs:

steps:
- name: Close obsolete channels
uses: canonical/actions/close-snap@release
uses: canonical/actions/close-snap@release # zizmor: ignore[unpinned-uses]
continue-on-error: true
with:
channel: edge/pr${{ github.event.number }}
Expand Down
43 changes: 29 additions & 14 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ env:
SCCACHE_PATH: /home/runner/.cargo/bin/sccache
ACTIONS_CACHE_SERVICE_V2: on

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Install rust
uses: ./.github/actions/rust-toolchain
Expand All @@ -28,7 +33,7 @@ jobs:
run: |
cargo build --all-features

- uses: actions/upload-artifact@v7
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: integration-tests
path: ./target/debug/sccache
Expand All @@ -41,7 +46,9 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Test
run: cd tests/integration && WITH_COVERAGE=1 make test-${{ matrix.type }}
Expand All @@ -56,7 +63,7 @@ jobs:
ls ../../target/integration-coverage/reports/lcov.info -l

- name: Upload coverage results (to Codecov.io)
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
with:
files: target/integration-coverage/reports/lcov.info
name: codecov-umbrella-integration-${{ matrix.type }}
Expand All @@ -75,10 +82,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Configure Cache Env
uses: actions/github-script@v8
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
Expand All @@ -89,7 +98,7 @@ jobs:
with:
toolchain: "stable"

- uses: actions/download-artifact@v8
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: integration-tests
path: /home/runner/.cargo/bin/
Expand Down Expand Up @@ -123,10 +132,12 @@ jobs:
SCCACHE_ERROR_LOG: "${{ github.workspace }}\\server_log.txt"

steps:
- uses: ilammy/msvc-dev-cmd@v1
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Install rust
uses: ./.github/actions/rust-toolchain
Expand Down Expand Up @@ -215,20 +226,22 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

# I don't want to break the cache during testing. Will turn on after I
# make sure it's working.
#
# - name: Configure Cache Env
# uses: actions/github-script@v8
# uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
# with:
# script: |
# core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
# core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '')

# - name: Configure ROCm Env
# uses: actions/github-script@v8
# uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
# with:
# script: |
# core.exportVariable('ROCM_PATH', process.env.ROCM_PATH || '');
Expand All @@ -251,7 +264,7 @@ jobs:
run: |
cargo build -p randomize_readdir

- uses: actions/download-artifact@v8
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: integration-tests
path: /home/runner/.cargo/bin/
Expand Down Expand Up @@ -304,7 +317,9 @@ jobs:
SCCACHE_PATH: target/debug/sccache
steps:
- name: Clone repository
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Install rust
uses: ./.github/actions/rust-toolchain
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
Snap:
runs-on: ubuntu-latest
Expand All @@ -12,12 +15,13 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@v5
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
fetch-depth: 0 # needed for version determination
persist-credentials: false

- name: Build and publish the snap
uses: canonical/actions/build-snap@release
uses: canonical/actions/build-snap@release # zizmor: ignore[unpinned-uses]
with:
snapcraft-channel: edge
review-opts: --allow-classic
Expand Down
Loading