-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (56 loc) · 1.56 KB
/
test-tools.yml
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
name: Test Security Tools container build
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
# This step takes ages (~4-5 min) but frees around 20 additional gigabytes
# that are quite useful when installing and running everything.
- name: Free up some disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: false
docker-images: false
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Load .env file
id: dotenv
uses: xom9ikk/dotenv@v2
- name: Prepare build args
id: prep
run: |
{
echo 'BUILD_ARGS<<EOF'
while IFS='=' read -r key value; do
if [[ ! -z "$key" && ! "$key" =~ ^# ]]; then
echo "${key}=${value}"
fi
done < .env
echo 'EOF'
} >> $GITHUB_OUTPUT
- name: Build container
uses: docker/build-push-action@v6
with:
push: false
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
tags: theredguild/container-sec-tools:latest
build-args: ${{ steps.prep.outputs.BUILD_ARGS }}
- name: Check disk space
run: df -h