From f67b5b45b6a56b59689708e4225ed8d9bad3abab Mon Sep 17 00:00:00 2001 From: Nic Cheneweth Date: Wed, 15 May 2024 17:29:15 -0500 Subject: [PATCH] [nc] test using gha-tools-action workflow for building job containers Signed-off-by: Nic Cheneweth --- .github/workflows/development-build.yaml | 11 ++- test/gha-container-base-image.bats | 85 ++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 test/gha-container-base-image.bats diff --git a/.github/workflows/development-build.yaml b/.github/workflows/development-build.yaml index 7190ab7..a9c9d14 100644 --- a/.github/workflows/development-build.yaml +++ b/.github/workflows/development-build.yaml @@ -12,8 +12,8 @@ on: jobs: - static-code-analysis: - name: static code analysis + dev-release: + name: development build and release uses: ThoughtWorks-DPS/gha-tools-action/.github/workflows/job-container-dev-release.yaml@main secrets: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} @@ -24,3 +24,10 @@ jobs: bats-version: 1.11.0 hadolint-version: 2.12.0 before-static-analysis: true + snyk-scan: true + snyk-severity-threshold: medium + snyk-organization: twdps + bats-test: true + bats-run-container-name: gha-container-base-image + bats-entry-point: /bin/ash + bats-test-path: test/gha-container-base-image.bats diff --git a/test/gha-container-base-image.bats b/test/gha-container-base-image.bats new file mode 100644 index 0000000..7302d83 --- /dev/null +++ b/test/gha-container-base-image.bats @@ -0,0 +1,85 @@ +#!/usr/bin/env bats + +@test "sudo version" { + run bash -c "docker exec gha-container-base-image sudo --version" + [[ "${output}" =~ "1.9" ]] +} + +@test "gettext install" { + run bash -c "docker exec gha-container-base-image less --version" + [[ "${output}" =~ "643" ]] +} + +@test "gcc version" { + run bash -c "docker exec gha-container-base-image gcc --version" + [[ "${output}" =~ "13.2" ]] +} + +@test "cmake version" { + run bash -c "docker exec gha-container-base-image cmake --version" + [[ "${output}" =~ "3.27" ]] +} +@test "make version" { + run bash -c "docker exec gha-container-base-image make --version" + [[ "${output}" =~ "4.4" ]] +} + +@test "curl version" { + run bash -c "docker exec gha-container-base-image curl --version" + [[ "${output}" =~ "8.5" ]] +} + +@test "wget version" { + run bash -c "docker exec gha-container-base-image wget --version" + [[ "${output}" =~ "1.21" ]] +} + +@test "unzip version" { + run bash -c "docker exec gha-container-base-image unzip --version" + [[ "${output}" =~ "6.0" ]] +} + +@test "zip version" { + run bash -c "docker exec gha-container-base-image zip --version" + [[ "${output}" =~ "3.0" ]] +} + +@test "jq version" { + run bash -c "docker exec gha-container-base-image jq --version" + [[ "${output}" =~ "1.7" ]] +} + +@test "gnupg version" { + run bash -c "docker exec gha-container-base-image gpg --version" + [[ "${output}" =~ "2.4" ]] +} + +@test "docker version" { + run bash -c "docker exec gha-container-base-image docker --version" + [[ "${output}" =~ "25.0" ]] +} + +@test "bash version" { + run bash -c "docker exec gha-container-base-image bash --version" + [[ "${output}" =~ "5.2" ]] +} + +@test "check locale" { + run bash -c "docker exec gha-container-base-image locale" + [[ "${output}" =~ "LC_ALL=en_US.UTF-8" ]] +} + +@test "1password version" { + run bash -c "docker exec gha-container-base-image op --version" + [[ "${output}" =~ "2.28" ]] +} + +@test "teller version" { + run bash -c "docker exec gha-container-base-image teller version" + [[ "${output}" =~ "1.5.6" ]] +} + +@test "vault version" { + run bash -c "docker exec gha-container-base-image vault -v" + [[ "${output}" =~ "1.16" ]] +}