-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: updated dependencies, improved coverage, and minor fixes
* test: added code coverage * test: fixed race condition bug * test: version tests * test: gocilint-fix * test: added more test * test: region validation flags * test: more tests * test: added test containers * test: added test containers2 * test: added test containers3 * test: added test containers5 * test: region validation flags * test: cleanup provider * test: clearing * test: clearing * ci: removed upload step * test: added more tests * test: added test for alias and versions func * test: executeClean test * test: executeClean test * test: executeClean test * test: executeClean test * test: executeClean test * test: executeClean test * test: versionCMD test * fix: removed global variable issues * fix: removed global variable issues * ci: added logic to prevent duplicate tests for PRs * ci: added codecov yml * ci: added codecov yml-2 * test: added test for root invocation * test: added test for root invocation * chore: ready for merge * test: added invalid custom file tests * test: added more test cases * test: fixed broken test * test: added invalid custom file tests
- Loading branch information
1 parent
7f1ecb6
commit 8e67800
Showing
34 changed files
with
2,942 additions
and
476 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,4 +1,4 @@ | ||
name: Release to Production | ||
name: Release | ||
|
||
on: | ||
push: | ||
|
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,20 +1,33 @@ | ||
name: PR-Review | ||
name: Pull Request Checks | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
branches: [ main ] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
LINT_VERSION: "1.25.1" | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
|
||
run-ci: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
if: ${{ !github.event.pull_request.draft }} | ||
steps: | ||
# If the condition above is not met, aka, the PR is not in draft status, then this step is skipped. | ||
# Because this step is part of the critical path, omission of this step will result in remaining CI steps not gettinge executed. | ||
# As of 8/8/2022 there is now way to enforce this beahvior in GitHub Actions CI. | ||
- run: exit 0 | ||
|
||
test: | ||
needs: [run-ci] | ||
outputs: | ||
VERSION: ${{ steps.go.outputs.version }} | ||
name: Test | ||
|
@@ -33,6 +46,9 @@ jobs: | |
|
||
|
||
- name: Generate AWS region file | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
aws ec2 describe-regions --all-regions --region us-east-1 --query "Regions[].RegionName" --output text >> cmd/aws-regions.txt | ||
|
@@ -42,15 +58,25 @@ jobs: | |
args: -v | ||
|
||
- name: Execute Go tests | ||
run: go get && go test -v ./... | ||
run: make tests-coverage | ||
|
||
- name: Codecov Upload | ||
uses: codecov/[email protected] | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Test CLI | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
go test -coverprofile=go.txt -v ./... | ||
go run main.go clean -r us-west-2 | ||
go run main.go version | ||
- name: build & execute | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
echo "--------------------------------------------------" | ||
go build -ldflags="-X 'github.com/karl-cardenas-coding/go-lambda-cleanup/cmd.VersionString=0.0.0'" -o=glc -v | ||
|
@@ -79,9 +105,4 @@ jobs: | |
build-args: VERSION=${{steps.dependencies.outputs.VERSION}} | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ghcr.io/${{ github.repository }}:test | ||
|
||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: test-results | ||
path: go.txt | ||
tags: ghcr.io/${{ github.repository }}:test |
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 |
---|---|---|
|
@@ -26,4 +26,5 @@ terraform.tfvars | |
lambda.zip | ||
main | ||
.DS_STORE | ||
main | ||
main | ||
coverage.out |
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.