[ENG-937] Work-around running out of space in GitHub CI for cache factory (#1158)

* Attmept to workaround Linux and Windows CI runners out-of-space problems

* Don't mix cmd and powershell

* bruh

* Attempt to fix prisma cache

* No need to cd, as the step is already in the correct cwd

* Leave enough room in root to install the necessary system packages

* Attempt to fix macOS cache being ovewritten

* Fix dumb mistake

* Up linux root free size to 6GB because
 - The cache action compress the data to root and it need more free space

* Remove pull_request trigger from cache_factory

---------

Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
Co-authored-by: Utku <74243531+utkubakir@users.noreply.github.com>
This commit is contained in:
Vítor Vasconcellos
2023-08-16 05:17:29 -03:00
committed by GitHub
parent c1a224e592
commit b69fa845a5
4 changed files with 86 additions and 10 deletions

View File

@@ -7,9 +7,9 @@ inputs:
save-cache:
description: Whether to save the Rust cache
required: false
default: 'false'
default: "false"
runs:
using: 'composite'
using: "composite"
steps:
- name: Install Rust
id: toolchain
@@ -22,25 +22,22 @@ runs:
- name: Cache Rust Dependencies
uses: Swatinem/rust-cache@v2
with:
key: ${{ inputs.targets }}
save-if: ${{ inputs.save-cache }}
prefix-key: 'v0'
shared-key: rust-deps
# Windows is having disk related problems with target caching
cache-targets: ${{ runner.os != 'Windows' }}
prefix-key: "v0-rust-deps"
shared-key: ${{ inputs.targets }}
- name: Restore cached Prisma codegen
id: cache-prisma-restore
uses: actions/cache/restore@v3
with:
key: prisma-1-${{ runner.os }}-${{ hashFiles('./core/prisma/*', './crates/sync-generator/*', './Cargo.toml') }}
path: ./crates/prisma/src/prisma*.rs
path: crates/prisma/src/**/*.rs
- name: Generate Prisma client
working-directory: core
if: ${{ steps.cache-prisma-restore.outputs.cache-hit != 'true' }}
shell: bash
run: cargo run -p prisma-cli --bin prisma -- generate
run: cargo prisma generate
- name: Save Prisma codegen
id: cache-prisma-save
@@ -48,4 +45,4 @@ runs:
uses: actions/cache/save@v3
with:
key: ${{ steps.cache-prisma-restore.outputs.cache-primary-key }}
path: ./crates/prisma/src/prisma*.rs
path: crates/prisma/src/**/*.rs

View File

@@ -49,9 +49,27 @@ jobs:
name: 'Make Cache'
runs-on: ${{ matrix.settings.host }}
steps:
- name: Maximize build space
if: ${{ runner.os == 'Linux' }}
uses: easimon/maximize-build-space@master
with:
swap-size-mb: 3072
root-reserve-mb: 6144
remove-dotnet: 'true'
remove-codeql: 'true'
remove-haskell: 'true'
remove-docker-images: 'true'
- name: Checkout repository
uses: actions/checkout@v3
- name: Symlink target to C:\
if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path C:\spacedrive_target
New-Item -Path target -ItemType Junction -Value C:\spacedrive_target
- name: Setup System and Rust
uses: ./.github/actions/setup-system
with:

View File

@@ -47,9 +47,27 @@ jobs:
name: Rust Formatting
runs-on: ubuntu-20.04
steps:
- name: Maximize build space
if: ${{ runner.os == 'Linux' }}
uses: easimon/maximize-build-space@master
with:
swap-size-mb: 3072
root-reserve-mb: 6144
remove-dotnet: 'true'
remove-codeql: 'true'
remove-haskell: 'true'
remove-docker-images: 'true'
- name: Checkout repository
uses: actions/checkout@v3
- name: Symlink target to C:\
if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path C:\spacedrive_target
New-Item -Path target -ItemType Junction -Value C:\spacedrive_target
- uses: dorny/paths-filter@v2
id: filter
with:
@@ -81,9 +99,27 @@ jobs:
matrix:
platform: [ubuntu-20.04, macos-latest, windows-latest]
steps:
- name: Maximize build space
if: ${{ runner.os == 'Linux' }}
uses: easimon/maximize-build-space@master
with:
swap-size-mb: 3072
root-reserve-mb: 6144
remove-dotnet: 'true'
remove-codeql: 'true'
remove-haskell: 'true'
remove-docker-images: 'true'
- name: Checkout repository
uses: actions/checkout@v3
- name: Symlink target to C:\
if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path C:\spacedrive_target
New-Item -Path target -ItemType Junction -Value C:\spacedrive_target
- uses: dorny/paths-filter@v2
id: filter
with:
@@ -100,6 +136,13 @@ jobs:
- 'Cargo.toml'
- 'Cargo.lock'
- name: Symlink target to C:\
if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path C:\spacedrive_target
New-Item -Path target -ItemType Junction -Value C:\spacedrive_target
- name: Setup System and Rust
if: steps.filter.outputs.changes == 'true'
uses: ./.github/actions/setup-system

View File

@@ -36,9 +36,27 @@ jobs:
name: Desktop - Main ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- name: Maximize build space
if: ${{ runner.os == 'Linux' }}
uses: easimon/maximize-build-space@master
with:
swap-size-mb: 3072
root-reserve-mb: 6144
remove-dotnet: 'true'
remove-codeql: 'true'
remove-haskell: 'true'
remove-docker-images: 'true'
- name: Checkout repository
uses: actions/checkout@v3
- name: Symlink target to C:\
if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path C:\spacedrive_target
New-Item -Path target -ItemType Junction -Value C:\spacedrive_target
- name: Remove 32-bit libs
if: ${{ runner.os == 'Linux' }}
run: |