Skip to content

Commit 6af8f37

Browse files
author
copyrights
committed
do not build server outside container build
1 parent 68c3e1d commit 6af8f37

File tree

2 files changed

+22
-50
lines changed

2 files changed

+22
-50
lines changed

.github/workflows/main.yaml

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-22.04
2424
steps:
2525
- uses: actions/checkout@v3
26-
26+
2727
- name: Free up disk space
2828
if: ${{ inputs.build_multiarch }}
2929
shell: bash
@@ -33,7 +33,7 @@ jobs:
3333
# ======
3434
# MACROS
3535
# ======
36-
36+
3737
# macro to print a line of equals
3838
# (silly but works)
3939
printSeparationLine() {
@@ -48,21 +48,21 @@ jobs:
4848
done
4949
echo "${output}"
5050
}
51-
51+
5252
# macro to compute available space
5353
# REF: https://unix.stackexchange.com/a/42049/60849
5454
# REF: https://stackoverflow.com/a/450821/408734
5555
getAvailableSpace() { echo $(df -a $1 | awk 'NR > 1 {avail+=$4} END {print avail}'); }
56-
56+
5757
# macro to make Kb human readable (assume the input is Kb)
5858
# REF: https://unix.stackexchange.com/a/44087/60849
5959
formatByteCount() { echo $(numfmt --to=iec-i --suffix=B --padding=7 $1'000'); }
60-
60+
6161
# macro to output saved space
6262
printSavedSpace() {
6363
saved=${1}
6464
title=${2:-}
65-
65+
6666
echo ""
6767
printSeparationLine '*' 80
6868
if [ ! -z "${title}" ]; then
@@ -73,11 +73,11 @@ jobs:
7373
printSeparationLine '*' 80
7474
echo ""
7575
}
76-
76+
7777
# macro to print output of dh with caption
7878
printDH() {
7979
caption=${1:-}
80-
80+
8181
printSeparationLine '=' 80
8282
echo "${caption}"
8383
echo ""
@@ -96,15 +96,15 @@ jobs:
9696
# ======
9797
# SCRIPT
9898
# ======
99-
99+
100100
# Display initial disk space stats
101-
101+
102102
AVAILABLE_INITIAL=$(getAvailableSpace)
103103
AVAILABLE_ROOT_INITIAL=$(getAvailableSpace '/')
104-
104+
105105
printDH "BEFORE CLEAN-UP:"
106106
echo ""
107-
107+
108108
# Remove Android library
109109
BEFORE=$(getAvailableSpace)
110110
@@ -113,7 +113,7 @@ jobs:
113113
AFTER=$(getAvailableSpace)
114114
SAVED=$((AFTER-BEFORE))
115115
printSavedSpace $SAVED "Android library"
116-
116+
117117
BEFORE=$(getAvailableSpace)
118118
119119
# https://github.community/t/bigger-github-hosted-runners-disk-space/17267/11
@@ -122,18 +122,18 @@ jobs:
122122
AFTER=$(getAvailableSpace)
123123
SAVED=$((AFTER-BEFORE))
124124
printSavedSpace $SAVED ".NET runtime"
125-
125+
126126
BEFORE=$(getAvailableSpace)
127127
128128
sudo rm -rf /opt/ghc
129129
130130
AFTER=$(getAvailableSpace)
131131
SAVED=$((AFTER-BEFORE))
132132
printSavedSpace $SAVED "Haskell runtime"
133-
133+
134134
# Remove large packages
135135
# REF: https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh
136-
136+
137137
BEFORE=$(getAvailableSpace)
138138
139139
sudo apt-get remove -y '^aspnetcore-.*'
@@ -149,7 +149,7 @@ jobs:
149149
AFTER=$(getAvailableSpace)
150150
SAVED=$((AFTER-BEFORE))
151151
printSavedSpace $SAVED "Large misc. packages"
152-
152+
153153
# Remove Docker images
154154
BEFORE=$(getAvailableSpace)
155155
@@ -169,18 +169,18 @@ jobs:
169169
AFTER=$(getAvailableSpace)
170170
SAVED=$((AFTER-BEFORE))
171171
printSavedSpace $SAVED "Swap storage"
172-
172+
173173
# Output saved space statistic
174-
174+
175175
AVAILABLE_END=$(getAvailableSpace)
176176
AVAILABLE_ROOT_END=$(getAvailableSpace '/')
177-
177+
178178
echo ""
179179
printDH "AFTER CLEAN-UP:"
180-
180+
181181
echo ""
182182
echo ""
183-
183+
184184
echo "/dev/root:"
185185
printSavedSpace $((AVAILABLE_ROOT_END - AVAILABLE_ROOT_INITIAL))
186186
echo "overall:"
@@ -189,15 +189,6 @@ jobs:
189189
- name: Install GraphViz
190190
run: sudo apt-get install graphviz -y
191191

192-
- name: Set up JDK 11
193-
uses: actions/setup-java@v3
194-
with:
195-
java-version: 11
196-
distribution: temurin
197-
198-
- name: Build Java server
199-
run: make buildServer
200-
201192
- name: Set up QEMU
202193
if: ${{ inputs.build_multiarch }}
203194
uses: docker/setup-qemu-action@v2
@@ -243,4 +234,3 @@ jobs:
243234
run: |
244235
rm -rf /tmp/.buildx-cache
245236
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
246-

.github/workflows/release.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
steps:
1212
- uses: actions/checkout@v3
13-
- name: Install GraphViz
14-
run: sudo apt-get install graphviz -y
15-
- name: Set up JDK 11
16-
uses: actions/setup-java@v3
17-
with:
18-
java-version: 11
19-
distribution: temurin
20-
- name: Build Java server
21-
run: make buildServer
2213
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
2314
- name: Generate checksums
2415
run: |
@@ -36,15 +27,6 @@ jobs:
3627
runs-on: ubuntu-22.04
3728
steps:
3829
- uses: actions/checkout@v3
39-
- name: Install GraphViz
40-
run: sudo apt-get install graphviz -y
41-
- name: Set up JDK 11
42-
uses: actions/setup-java@v3
43-
with:
44-
java-version: 11
45-
distribution: temurin
46-
- name: Build Java server
47-
run: make buildServer
4830
- name: Set up QEMU
4931
uses: docker/setup-qemu-action@v2
5032
- name: Set up Docker Buildx

0 commit comments

Comments
 (0)