diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6b80dd57..81ff06e8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,7 +9,11 @@ on: pull_request: branches: [main] +permissions: + contents: read + env: + CARGO_INCREMENTAL: 0 CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 @@ -17,7 +21,7 @@ jobs: check-style: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Report cargo version run: cargo --version - name: Report rustfmt version @@ -28,12 +32,12 @@ jobs: clippy-lint: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Report cargo version run: cargo --version - name: Report Clippy version run: cargo clippy -- --version - - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: cache-bin: false # See Swatinem/rust-cache#341. - name: Run Clippy Lints @@ -42,10 +46,10 @@ jobs: check-docs: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Report cargo version run: cargo --version - - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: cache-bin: false # See Swatinem/rust-cache#341. - name: Check Docs @@ -54,8 +58,7 @@ jobs: build-and-test: runs-on: ${{ matrix.os }} env: - # rust-toolchain.toml overrides the dtolnay/rust-toolchain selection -- - # set this environment variable, which overrides rust-toolchain.toml. + # Override rust-toolchain.toml using explicit RUSTUP_TOOLCHAIN RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }} strategy: matrix: @@ -72,15 +75,15 @@ jobs: # Keep this in sync with rust-version in Cargo.toml. toolchain: "1.88" steps: - - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 - - uses: dtolnay/rust-toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Install Rust toolchain + shell: bash + run: rustup toolchain install ${{ matrix.toolchain }} --profile minimal --no-self-update - name: Report cargo version run: cargo --version - name: Report rustc version run: rustc --version - - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: # Matrix instances other than OS need to be added to this explicitly key: ${{ matrix.features }} @@ -94,16 +97,16 @@ jobs: trybuild: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 - # rust-toolchain.toml overrides dtolnay/rust-toolchain@stable, so in some - # sense using it is pointless. But it does a few other useful things such - # as disable incremental compilation, so we use it anyway. - - uses: dtolnay/rust-toolchain@stable + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + # toolchain is pinned by rust-toolchain.toml which is required as the trybuild + # fixtures assert exact rustc diagnostics against committed .stderr files. + - name: Install Rust toolchain from rust-toolchain.toml + run: rustup toolchain install - name: Report cargo version run: cargo --version - name: Report rustc version run: rustc --version - - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: cache-bin: false # See Swatinem/rust-cache#341. - name: Run trybuild tests diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index 7f7e7595..349e6877 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -7,12 +7,16 @@ on: - dropshot/tests/test_openapi_fuller.json workflow_dispatch: inputs: + +permissions: + contents: read + jobs: format: runs-on: ubuntu-latest steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - - uses: actions/setup-node@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: '24' - name: Install our tools