Skip to content

Commit d4c5445

Browse files
authored
Merge pull request #1387 from Phala-Network/max-space
CI: Use our own maximize space script
2 parents 4606e38 + fd61544 commit d4c5445

File tree

3 files changed

+42
-54
lines changed

3 files changed

+42
-54
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Maximize disk space"
2+
description: "Maximize disk space"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Remove unused tools
7+
run: >
8+
df -h &&
9+
sudo rm -rf /usr/local/.ghcup
10+
/usr/local/share/powershell
11+
/usr/local/share/chromium
12+
/usr/share/swift
13+
/opt/hostedtoolcache/Python
14+
/opt/hostedtoolcache/CodeQL
15+
/opt/hostedtoolcache/PyPy
16+
/opt/hostedtoolcache/Ruby
17+
/opt/hostedtoolcache/go
18+
/imagegeneration/installers/*.tar.gz
19+
/usr/local/lib/android
20+
/usr/lib/google-cloud-sdk
21+
/usr/lib/jvm
22+
/opt/microsoft
23+
&& df -h
24+
shell: bash
25+
- name: Setup swap
26+
run: |
27+
SWAP_FILE=/mnt/swapfile
28+
sudo swapoff -a
29+
sudo rm -f ${SWAP_FILE}
30+
sudo fallocate -l 12G ${SWAP_FILE}
31+
sudo chmod 600 ${SWAP_FILE}
32+
sudo mkswap ${SWAP_FILE}
33+
sudo swapon ${SWAP_FILE}
34+
sudo swapon --show
35+
df -h
36+
shell: bash

.github/workflows/build-nightly-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- uses: actions/checkout@v3
1818
with:
1919
submodules: true
20+
- uses: ./.github/actions/maximize-disk-space
2021
- uses: ./.github/actions/build-core
2122
with:
2223
profile: release
@@ -28,6 +29,7 @@ jobs:
2829
- uses: actions/checkout@v3
2930
with:
3031
submodules: true
32+
- uses: ./.github/actions/maximize-disk-space
3133
- uses: ./.github/actions/build-pruntime
3234

3335
build-contracts:

.github/workflows/build.yml

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,24 @@ jobs:
1414
name: Build core
1515
runs-on: ubuntu-20.04
1616
steps:
17-
- name: Maximize build space
18-
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
19-
with:
20-
root-reserve-mb: 4096
21-
temp-reserve-mb: 1024
22-
swap-size-mb: 8192
23-
remove-dotnet: "true"
24-
remove-android: "true"
25-
remove-haskell: "true"
2617
- uses: actions/checkout@v3
2718
with:
2819
submodules: 'true'
20+
- uses: ./.github/actions/maximize-disk-space
2921
- uses: ./.github/actions/build-core
3022
build-pruntime:
3123
name: Build pruntime
3224
runs-on: ubuntu-20.04
3325
steps:
34-
- name: Maximize build space
35-
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
36-
with:
37-
root-reserve-mb: 4096
38-
temp-reserve-mb: 1024
39-
swap-size-mb: 8192
40-
remove-dotnet: "true"
41-
remove-android: "true"
42-
remove-haskell: "true"
4326
- uses: actions/checkout@v3
4427
with:
4528
submodules: 'true'
29+
- uses: ./.github/actions/maximize-disk-space
4630
- uses: ./.github/actions/build-pruntime
4731
build-prouter:
4832
name: Build prouter
4933
runs-on: ubuntu-20.04
5034
steps:
51-
- name: Maximize build space
52-
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
53-
with:
54-
root-reserve-mb: 4096
55-
temp-reserve-mb: 1024
56-
swap-size-mb: 8192
57-
remove-dotnet: "true"
58-
remove-android: "true"
59-
remove-haskell: "true"
6035
- uses: actions/checkout@v3
6136
with:
6237
submodules: 'true'
@@ -73,15 +48,6 @@ jobs:
7348
name: Run E2E tests
7449
runs-on: ubuntu-20.04
7550
steps:
76-
- name: Maximize build space
77-
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
78-
with:
79-
root-reserve-mb: 4096
80-
temp-reserve-mb: 1024
81-
swap-size-mb: 8192
82-
remove-dotnet: "true"
83-
remove-android: "true"
84-
remove-haskell: "true"
8551
- uses: actions/checkout@v3
8652
with:
8753
submodules: 'true'
@@ -130,40 +96,24 @@ jobs:
13096
name: Run cargo tests
13197
runs-on: ubuntu-20.04
13298
steps:
133-
- name: Maximize build space
134-
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
135-
with:
136-
root-reserve-mb: 4096
137-
temp-reserve-mb: 1024
138-
swap-size-mb: 8192
139-
remove-dotnet: "true"
140-
remove-android: "true"
141-
remove-haskell: "true"
14299
- uses: actions/checkout@v3
143100
with:
144101
submodules: 'true'
145102
- uses: ./.github/actions/install_toolchain
103+
- uses: ./.github/actions/maximize-disk-space
146104
- name: Run cargo tests
147105
run: cargo test --tests --release --workspace --exclude node-executor --exclude phala-node
148106

149107
cargo-clippy:
150108
name: Run cargo clippy
151109
runs-on: ubuntu-20.04
152110
steps:
153-
- name: Maximize build space
154-
uses: easimon/maximize-build-space@master # https://github.com/easimon/maximize-build-space
155-
with:
156-
root-reserve-mb: 4096
157-
temp-reserve-mb: 1024
158-
swap-size-mb: 8192
159-
remove-dotnet: "true"
160-
remove-android: "true"
161-
remove-haskell: "true"
162111
- uses: actions/checkout@v3
163112
with:
164113
submodules: 'true'
165114
- uses: ./.github/actions/install_toolchain
166115
- name: Install clippy
167116
run: rustup component add clippy
117+
- uses: ./.github/actions/maximize-disk-space
168118
- name: Run cargo clippy
169119
run: cargo clippy --tests -- -D warnings && cd standalone/pruntime && cargo clippy --tests -- -D warnings

0 commit comments

Comments
 (0)