-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6861 from Checkmarx/increase-workflows-coverage
feat(tests): add new test workflows
- Loading branch information
Showing
57 changed files
with
571 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
module github.com/Checkmarx/e2e-report | ||
|
||
go 1.16 | ||
go 1.21 | ||
|
||
require github.com/tdewolff/minify/v2 v2.9.21 | ||
require ( | ||
github.com/rs/zerolog v1.31.0 | ||
github.com/tdewolff/minify/v2 v2.9.21 | ||
) | ||
|
||
require ( | ||
github.com/mattn/go-colorable v0.1.13 // indirect | ||
github.com/mattn/go-isatty v0.0.19 // indirect | ||
github.com/tdewolff/parse/v2 v2.5.19 // indirect | ||
golang.org/x/sys v0.12.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: go-e2e-debian | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
e2e-debian-tests: | ||
name: e2e-debian-tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: [1.21.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.11.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Set up Go 1.21.x | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Print go env | ||
run: go env | ||
- name: Get Modules | ||
run: go mod vendor | ||
- name: Set up Node v14 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
- name: Install mock server | ||
run: npm ci | ||
working-directory: .github/scripts/server-mock | ||
- name: Start mock server | ||
run: (npm run start&) | ||
working-directory: .github/scripts/server-mock | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.ref }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx-${{ github.ref }} | ||
- name: Append Entrypoint in dockerfile | ||
run: | | ||
echo "ENTRYPOINT [\"/app/bin/kics\"]" >> docker/Dockerfile.debian | ||
- name: Get short SHA | ||
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-8)" >> $GITHUB_ENV | ||
- name: Build | ||
id: docker_build | ||
uses: docker/build-push-action@v5.0.0 | ||
with: | ||
load: true | ||
context: ./ | ||
file: ./docker/Dockerfile.debian | ||
builder: ${{ steps.buildx.outputs.name }} | ||
push: false | ||
tags: kics:e2e-debian-tests-${{ github.sha }} | ||
build-args: | | ||
VERSION=development | ||
COMMIT=${{ github.sha }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} | ||
- name: Display PWD / Files | ||
run: | | ||
pwd | ||
ls | ||
- name: Set Output Permissions | ||
run: | | ||
sudo chmod -R 777 ./e2e | ||
- name: Run E2E Tests | ||
env: | ||
E2E_KICS_DOCKER: kics:e2e-debian-tests-${{ github.sha }} | ||
E2E_KICS_QUERIES_PATH: ${{ steps.getbin.outputs.queries }} | ||
run: | | ||
go test -tags dev "github.com/Checkmarx/kics/e2e" -timeout 1500s -json > results.json | ||
- name: Generate E2E Report | ||
if: always() | ||
env: | ||
E2E_KICS_DOCKERFILE: docker/Dockerfile.debian | ||
run: | | ||
CWD=$(pwd) | ||
cd .github/scripts/report | ||
go mod tidy | ||
go build | ||
./e2e-report -test-path ${CWD} -test-name results.json -report-path ${CWD} -report-name e2e-report.html | ||
- name: Get docker name | ||
run: | | ||
DOCKER_NAME=$(echo docker/Dockerfile.debian | sed 's/\//-/') | ||
- name: Archive test report | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: e2e-tests-report-$DOCKER_NAME | ||
path: e2e-report.html | ||
# dummy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.