-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (62 loc) · 1.7 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: CI
on: push
jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Init
run: |
df -h
sudo apt-get update
- name: Maximize free space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Freespace Check
run: |
df -h
REQUIRED_FREE_SPACE=25
free_space=$(df -h . | awk '{print $4}' | grep "G")
free_space="${free_space%G}"
if [ -z "$free_space" ]; then
echo "ERROR: free_space variable is empty or not set." >&2
exit 1
fi
df -h
echo "Free space (required): ${REQUIRED_FREE_SPACE} GB"
echo "Free space (available): ${free_space} GB"
if (( REQUIRED_FREE_SPACE > free_space )); then
echo "ERROR: Insufficient free space: ${free_space} GB available, ${REQUIRED_FREE_SPACE} GB required." >&2
exit 1
fi
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install requirements
run: |
df -h
sudo apt-get update
sudo apt-get install -y make
- name: Build
run: |
df -h
(cd apt_cacher_ng_docker && make up )
make build
make save_docker_images
- name: CI Test
run: |
df -h
make ci_test
- name: Upload Logs
uses: actions/upload-artifact@v2
with:
name: logs
path: .log
if: always()