From 81924223c6fb3f3dfa71fdae3afbb26827d8ab5f Mon Sep 17 00:00:00 2001 From: Alex Koshelev Date: Wed, 8 Nov 2023 10:05:30 -0800 Subject: [PATCH 1/4] Clean up runner space before running actions 14Gb default space is probably not enough for us anymore ``` [ec2-user@ip-172-31-49-57 ipa]$ du -sh target/ 36G target/ ``` see the discussion here https://github.com/actions/runner-images/issues/2875 --- .github/workflows/check.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5224f9abd..9e1935d38 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -22,6 +22,26 @@ env: RUSTDOCFLAGS: -D warnings jobs: + # https://github.com/marketplace/actions/free-disk-space-ubuntu + free-disk-space: + runs-on: ubuntu-latest + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true + basic: name: Basic Checks env: From 08e6c576c72188c097f01accf681a4823265eba4 Mon Sep 17 00:00:00 2001 From: Alex Koshelev Date: Wed, 8 Nov 2023 10:14:03 -0800 Subject: [PATCH 2/4] Add job dependencies --- .github/workflows/check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9e1935d38..17e6a7f5f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -44,9 +44,9 @@ jobs: basic: name: Basic Checks + needs: free-disk-space env: CARGO_INCREMENTAL: 0 - runs-on: ubuntu-latest steps: @@ -89,6 +89,7 @@ jobs: release: name: Release builds and tests + needs: free-disk-space runs-on: ubuntu-latest env: RUSTFLAGS: -C target-cpu=native @@ -120,6 +121,7 @@ jobs: extra: name: Additional Builds and Concurrency Tests + needs: free-disk-space env: RUSTFLAGS: -D warnings -C target-cpu=native From b0c93dec8c8715ed6ad3fbc30903d2e13072efd1 Mon Sep 17 00:00:00 2001 From: Alex Koshelev Date: Wed, 8 Nov 2023 10:41:08 -0800 Subject: [PATCH 3/4] Create reusable action --- .github/actions/rm/action.yml | 17 +++++++++++++++++ .github/workflows/check.yml | 24 +++--------------------- 2 files changed, 20 insertions(+), 21 deletions(-) create mode 100644 .github/actions/rm/action.yml diff --git a/.github/actions/rm/action.yml b/.github/actions/rm/action.yml new file mode 100644 index 000000000..2db654b62 --- /dev/null +++ b/.github/actions/rm/action.yml @@ -0,0 +1,17 @@ +# https://github.com/marketplace/actions/free-disk-space-ubuntu +name: 'Free disk space' +description: 'Frees up disk space on Github Ubuntu runners' +runs: + using: composite + steps: + uses: jlumbroso/free-disk-space@main + with: + # if we still don't have enough space, we can try setting this to true + tool-cache: false + + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 17e6a7f5f..711f9a979 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -22,34 +22,14 @@ env: RUSTDOCFLAGS: -D warnings jobs: - # https://github.com/marketplace/actions/free-disk-space-ubuntu - free-disk-space: - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: false - - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true - basic: name: Basic Checks - needs: free-disk-space env: CARGO_INCREMENTAL: 0 runs-on: ubuntu-latest steps: + - uses: actions/rm@v1 - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -94,6 +74,7 @@ jobs: env: RUSTFLAGS: -C target-cpu=native steps: + - uses: actions/rm@v1 - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -128,6 +109,7 @@ jobs: runs-on: ubuntu-latest steps: + - uses: actions/rm@v1 - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable From 069eb3a424890bd8502b6d7aece4aff0b11fe04a Mon Sep 17 00:00:00 2001 From: Alex Koshelev Date: Wed, 8 Nov 2023 10:46:02 -0800 Subject: [PATCH 4/4] Call local action --- .github/workflows/check.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 711f9a979..300c2854a 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/rm@v1 + - uses: ./.github/actions/rm - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -69,12 +69,11 @@ jobs: release: name: Release builds and tests - needs: free-disk-space runs-on: ubuntu-latest env: RUSTFLAGS: -C target-cpu=native steps: - - uses: actions/rm@v1 + - uses: ./.github/actions/rm - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -102,14 +101,13 @@ jobs: extra: name: Additional Builds and Concurrency Tests - needs: free-disk-space env: RUSTFLAGS: -D warnings -C target-cpu=native runs-on: ubuntu-latest steps: - - uses: actions/rm@v1 + - uses: ./.github/actions/rm - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable