Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Disable Rust cache #1719

Merged
merged 8 commits into from
Mar 8, 2024
Merged
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
35 changes: 26 additions & 9 deletions .github/actions/rust/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: Install Rust
description: Install Rust and sccache
description: Install Rust and tools

inputs:
version:
description: 'Rust toolchain version to install'
required: true
default: 'stable'
components:
description: 'Rust components to install'
required: false
default: ''

runs:
Expand All @@ -25,7 +23,7 @@ runs:
shell: pwsh
run: Set-ExecutionPolicy Unrestricted -Scope Process; iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Content

- name: Install cargo-binstall (Windows)
- name: Install cargo-binstall (Linux & MacOS)
if: runner.os != 'Windows'
shell: bash
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
Expand All @@ -34,8 +32,27 @@ runs:
shell: bash
run: cargo +${{ inputs.version }} binstall --no-confirm cargo-llvm-cov cargo-nextest flamegraph cargo-hack

- name: Use Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
cache-directories: "${{ github.workspace }}/dist"
# sccache slows CI down, so we leave it disabled.
# Leaving the steps below commented out, so we can re-evaluate enabling it later.
# - name: Use sccache
# uses: mozilla-actions/[email protected]

# - name: Enable sscache
# shell: bash
# run: |
# if [ "${{ runner.os }}" = "Windows" ]; then
# echo "CC=sccache cl" >> "$GITHUB_ENV"
# echo "CXX=sccache cl" >> "$GITHUB_ENV"
# else
# echo "CC=sccache cc" >> "$GITHUB_ENV"
# echo "CXX=sccache c++" >> "$GITHUB_ENV"
# fi
# echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
# echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
# echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"

# Ditto for rust-cache.
# - name: Use Rust cache
# uses: Swatinem/rust-cache@v2
# with:
# cache-all-crates: "true"
12 changes: 6 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust
uses: ./.github/actions/rust
with:
version: ${{ matrix.rust-toolchain }}
components: rustfmt, clippy, llvm-tools-preview

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
env:
Expand Down Expand Up @@ -97,6 +91,12 @@ jobs:
# See https://github.com/ilammy/msvc-dev-cmd#name-conflicts-with-shell-bash
rm /usr/bin/link.exe

- name: Install Rust
uses: ./.github/actions/rust
with:
version: ${{ matrix.rust-toolchain }}
components: rustfmt, clippy, llvm-tools-preview

- name: Fetch and build NSS and NSPR
uses: ./.github/actions/nss

Expand Down