Skip to content

Commit

Permalink
[nc] test using gha-tools-action workflow for building job containers
Browse files Browse the repository at this point in the history
Signed-off-by: Nic Cheneweth <[email protected]>
  • Loading branch information
ncheneweth committed May 15, 2024
1 parent c92e973 commit f67b5b4
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/development-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
85 changes: 85 additions & 0 deletions test/gha-container-base-image.bats
Original file line number Diff line number Diff line change
@@ -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" ]]
}

0 comments on commit f67b5b4

Please sign in to comment.