Code Monkey home page Code Monkey logo

max-build-space's Introduction

max-build-space

Maximize available disk space for build tasks

Added free-disk-space ability to remove large packets on the basis of maximize-build-disk-space

On Ubuntu 22.04.2, max have 70G disk space for you workspace, use this action.

Example

before:

before

use action:

    - name: Maximize build space
      uses: gmij/max-build-space@main
      with:
        root-reserve-mb: 512
        swap-size-mb: 1024
        remove-android: 'true'
        remove-haskell: 'true'
        remove-docker-images: 'true'
        remove-codeql: 'true'
        remove-large-packages: 'true'
        remove-tool-cache: 'true'

after:

after

Usage

name: My build action requiring more space
on: push

jobs:
  build:
    name: Build my artifact
    runs-on: ubuntu-latest
    steps:
      - name: Maximize build space
        uses: gmij/max-build-space@main
        with:
          root-reserve-mb: 512
          swap-size-mb: 1024
          remove-dotnet: 'true'
      - name: Checkout
        uses: actions/checkout@v3

      - name: Build
        run: |
          echo "Free space:"
          df -h

Inputs

inputs:
  root-reserve-mb:
    description: 'Space to be left free on the root filesystem, in Megabytes.'
    required: false
    default: '1024'
  temp-reserve-mb:
    description: 'Space to be left free on the temp filesystem (/mnt), in Megabytes.'
    required: false
    default: '100'
  swap-size-mb:
    description: 'Swap space to create, in Megabytes.'
    required: false
    default: '4096'
  overprovision-lvm:
    description: |
      Create the LVM disk images as sparse files, making the space required for the LVM image files *appear* unused on the
      hosting volumes until actually allocated. Use with care, this can lead to surprising out-of-disk-space situations.
      You should prefer adjusting root-reserve-mb/temp-reserve-mb over using this option.
    required: false
    default: 'false'
  build-mount-path:
    description: |
      'Absolute path to the mount point where the build space will be available,
      defaults to $GITHUB_WORKSPACE if unset.'
    required: false
  pv-loop-path:
    description: |
      'Absolute file path for the LVM image created on the root filesystem, the default is usually fine.'
    required: false
    default: '/pv.img'
  tmp-pv-loop-path:
    description: |
      'Absolute file path for the LVM image created on the temp filesystem,
      the default is usually fine. Must reside on /mnt'
    required: false
    default: '/mnt/tmp-pv.img'
  remove-dotnet:
    description: 'Removes .NET runtime and libraries. (frees ~17 GB)'
    required: false
    default: 'false'
  remove-android:
    description: 'Removes Android SDKs and Tools. (frees ~11 GB)'
    required: false
    default: 'false'
  remove-haskell:
    description: 'Removes GHC (Haskell) artifacts. (frees ~2.7 GB)'
    required: false
    default: 'false'
  remove-codeql:
    description: 'Removes CodeQL Action Bundles. (frees ~5.4 GB)'
    required: false
    default: 'false'
  remove-docker-images:
    description: 'Removes cached Docker images. (frees ~3 GB)'
    required: false
    default: 'false'
  # option inspired by:
  # https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh    
  remove-large-packages:
    description: 'Removes large packages. (frees ~4.6 GB)'
    required: false
    default: 'false'
  remove-tool-cache:
    description: 'Removes tool cache. (frees ~3 GB)'
    required: false
    default: 'false'    

max-build-space's People

Contributors

gmij avatar

Watchers

 avatar

Forkers

harvey365

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.