forked from Checkmarx/kics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(env): added dev build tag (Checkmarx#4729)
Signed-off-by: João Reigota <[email protected]>
- Loading branch information
1 parent
db927f9
commit a143128
Showing
9 changed files
with
99 additions
and
3 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 |
---|---|---|
|
@@ -51,6 +51,12 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
persist-credentials: false | ||
- uses: dorny/paths-filter@v2 | ||
id: changes | ||
with: | ||
filters: | | ||
src: | ||
- 'pkg/terraformer/**' | ||
- name: Get cache paths | ||
id: go-cache-paths | ||
run: | | ||
|
@@ -76,15 +82,25 @@ jobs: | |
maximum-size: 32GB | ||
disk-root: "C:" | ||
- name: Test and Generate Report | ||
if: matrix.os != 'windows-latest' | ||
if: matrix.os != 'windows-latest' && steps.changes.outputs.src == 'true' | ||
run: | | ||
go test -mod=vendor -v $(go list ./... | grep -v e2e) -count=1 -coverprofile=cover.out | tee unit-test.log | ||
result_code=${PIPESTATUS[0]} | ||
exit $result_code | ||
- name: Test and Generate Report Dev | ||
if: matrix.os != 'windows-latest' && steps.changes.outputs.src == 'false' | ||
run: | | ||
go test -tags dev -mod=vendor -v $(go list -tags dev ./... | grep -v e2e) -count=1 -coverprofile=cover.out | tee unit-test.log | ||
result_code=${PIPESTATUS[0]} | ||
exit $result_code | ||
- name: Test and Generate Report Windows | ||
if: matrix.os == 'windows-latest' | ||
if: matrix.os == 'windows-latest' && steps.changes.outputs.src == 'true' | ||
run: | | ||
go test -mod=vendor -v $(go list ./... | grep -v e2e) -count=1 -coverprofile=cover.out | tee unit-test.log | ||
- name: Test and Generate Report Windows Dev | ||
if: matrix.os == 'windows-latest' && steps.changes.outputs.src == 'false' | ||
run: | | ||
go test -mod=vendor -tags dev -v $(go list -tags dev ./... | grep -v e2e) -count=1 -coverprofile=cover.out | tee unit-test.log | ||
- name: Archive test logs | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
|
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 |
---|---|---|
|
@@ -24,7 +24,7 @@ jobs: | |
- name: Set up Node v14 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
node-version: "14" | ||
- name: Check out code | ||
uses: actions/[email protected] | ||
with: | ||
|
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//go:build !dev | ||
// +build !dev | ||
|
||
package aws | ||
|
||
import ( | ||
|
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,3 +1,6 @@ | ||
//go:build !dev | ||
// +build !dev | ||
|
||
package aws | ||
|
||
import ( | ||
|
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,3 +1,6 @@ | ||
//go:build !dev | ||
// +build !dev | ||
|
||
package terraformer | ||
|
||
import ( | ||
|
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,17 @@ | ||
//go:build dev | ||
// +build dev | ||
|
||
package terraformer | ||
|
||
/* | ||
Since terraformer import is very big, this creates problems for the dev env | ||
regarding CPU and MEM usage. | ||
To fix this issue an alternative terraformer file is used which disables terraformer, | ||
and mocks the import function. | ||
To use this alternative terraformer file, be sure to run kics with the tag "dev". | ||
*/ | ||
|
||
// Import is a mock function that does nothing | ||
func Import(terraformerPath, destinationPath string) (string, error) { | ||
return "", nil | ||
} |
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,3 +1,6 @@ | ||
//go:build !dev | ||
// +build !dev | ||
|
||
package terraformer | ||
|
||
import ( | ||
|