diff --git a/.env b/.env index de51b5a..d70c3a6 100644 --- a/.env +++ b/.env @@ -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 \ No newline at end of file +T_DOCKLE=0.4.14 + diff --git a/.github/workflows/test-tools.yml b/.github/workflows/test-tools.yml index d4b2aab..754d08b 100644 --- a/.github/workflows/test-tools.yml +++ b/.github/workflows/test-tools.yml @@ -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 \ No newline at end of file + - name: Load .env file + id: dotenv + uses: xom9ikk/dotenv@v2 + + - name: Prepare build args + id: prep + run: | + { + echo 'BUILD_ARGS<> $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