From 6423b450e3ce05c0097848394af6e964faf6ab63 Mon Sep 17 00:00:00 2001 From: Nicolas Rey Date: Thu, 17 Oct 2024 18:08:39 -0300 Subject: [PATCH 1/4] ci: remove dangling packages from CI workers --- .github/workflows/test-tools.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-tools.yml b/.github/workflows/test-tools.yml index d4b2aab..bd9da98 100644 --- a/.github/workflows/test-tools.yml +++ b/.github/workflows/test-tools.yml @@ -4,19 +4,27 @@ 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: true + swap-storage: true + - name: Checkout uses: actions/checkout@v4 @@ -26,4 +34,4 @@ jobs: - name: Build container using Make run: make build env: - DOCKER_BUILDKIT: 1 \ No newline at end of file + DOCKER_BUILDKIT: 1 From f0e4719ec59c2fd5f0ea9989d525f506266a93af Mon Sep 17 00:00:00 2001 From: Nicolas Rey Date: Thu, 17 Oct 2024 18:30:51 -0300 Subject: [PATCH 2/4] ci: save some ci run time by not deleting some of the unwanted tools --- .github/workflows/test-tools.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-tools.yml b/.github/workflows/test-tools.yml index bd9da98..a7cb833 100644 --- a/.github/workflows/test-tools.yml +++ b/.github/workflows/test-tools.yml @@ -22,8 +22,9 @@ jobs: android: true dotnet: true haskell: true - large-packages: true - swap-storage: true + large-packages: false + swap-storage: false + docker-images: false - name: Checkout uses: actions/checkout@v4 @@ -35,3 +36,6 @@ jobs: run: make build env: DOCKER_BUILDKIT: 1 + + - name: Check disk space + run: df -h From 2214f81be5d3ffbab0cfa250335ffcfef0f3d066 Mon Sep 17 00:00:00 2001 From: Nicolas Rey Date: Fri, 18 Oct 2024 10:23:07 -0300 Subject: [PATCH 3/4] ci: use the build args from the dotenv file --- .github/workflows/test-tools.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-tools.yml b/.github/workflows/test-tools.yml index a7cb833..754d08b 100644 --- a/.github/workflows/test-tools.yml +++ b/.github/workflows/test-tools.yml @@ -32,10 +32,32 @@ jobs: - 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<> $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 From eec4e41831bdd4b332ff26db36b36d0003758493 Mon Sep 17 00:00:00 2001 From: Nicolas Rey Date: Sat, 19 Oct 2024 13:20:09 -0300 Subject: [PATCH 4/4] add missing newline at the end --- .env | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 +