Skip to content

Commit

Permalink
Merge pull request #46 from theredguild/ci-moar-space
Browse files Browse the repository at this point in the history
ci: remove dangling packages from CI workers
  • Loading branch information
mattaereal authored Oct 21, 2024
2 parents 4e4eda9 + eec4e41 commit b6ae673
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ T_HADOLINT=2.12.0
T_DEPCHECK=10.0.4
T_NODEJSSCAN=3.7
T_RETIRE=5.2.4
T_DOCKLE=0.4.14
T_DOCKLE=0.4.14

50 changes: 42 additions & 8 deletions .github/workflows/test-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,60 @@ on:
branches:
- main
- develop
paths:
- Dockerfile
pull_request:
branches:
- main
- develop
paths:
- Dockerfile

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: Build container using Make
run: make build
env:
DOCKER_BUILDKIT: 1
- 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

0 comments on commit b6ae673

Please sign in to comment.