Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GH Actions which will build Dockerfile if updated #291

Closed
antonbabenko opened this issue Dec 6, 2021 · 11 comments · Fixed by #318
Closed

Add GH Actions which will build Dockerfile if updated #291

antonbabenko opened this issue Dec 6, 2021 · 11 comments · Fixed by #318
Assignees
Labels
area/docker estimate/4h Need 4 hours to be done good first issue Good for newcomers

Comments

@antonbabenko
Copy link
Owner

GH Actions for pull-requests which runs docker build when Dockerfile changes and run the smoke test?

No need to push it to GHCR but just getting versions should be enough. Similar to this one - https://github.com/antonbabenko/pre-commit-terraform/blob/master/.github/workflows/build-image.yaml

Originally posted by @antonbabenko in #288 (comment)

@mohitsaxenaknoldus
Copy link
Contributor

Hey, can I work on this?

@antonbabenko
Copy link
Owner Author

Sure, @mohitsaxenaknoldus !

@mohitsaxenaknoldus
Copy link
Contributor

Where can I find the smoke tests?

@MaxymVlasov
Copy link
Collaborator

MaxymVlasov commented Jan 8, 2022

If you write them and populate them somewhere in the tests/ folder + info on how to use them in .github/CONTRIBUTING.md it will be helpful.

For now, we have only some kind of performance tests

@mohitsaxenaknoldus
Copy link
Contributor

So I also have to create the smoke tests as well then?

@MaxymVlasov
Copy link
Collaborator

Yep

@mohitsaxenaknoldus
Copy link
Contributor

I've added workflow which will build the Dockerfile if it was changed but I've never worked with smoke tests before :(

@mohitsaxenaknoldus
Copy link
Contributor

Here's the work so far: #318

@MaxymVlasov
Copy link
Collaborator

Maybe we already have the simplest optimistic smoke test here:

# Checking binaries versions and write it to debug file
RUN . /.env && \
F=tools_versions_info && \
pre-commit --version >> $F && \
./terraform --version | head -n 1 >> $F && \
(if [ "$CHECKOV_VERSION" != "false" ]; then echo "checkov $(checkov --version)" >> $F; else echo "checkov SKIPPED" >> $F ; fi) && \
(if [ "$INFRACOST_VERSION" != "false" ]; then echo "$(./infracost --version)" >> $F; else echo "infracost SKIPPED" >> $F ; fi) && \
(if [ "$TERRAFORM_DOCS_VERSION" != "false" ]; then ./terraform-docs --version >> $F; else echo "terraform-docs SKIPPED" >> $F ; fi) && \
(if [ "$TERRAGRUNT_VERSION" != "false" ]; then ./terragrunt --version >> $F; else echo "terragrunt SKIPPED" >> $F ; fi) && \
(if [ "$TERRASCAN_VERSION" != "false" ]; then echo "terrascan $(./terrascan version)" >> $F; else echo "terrascan SKIPPED" >> $F ; fi) && \
(if [ "$TFLINT_VERSION" != "false" ]; then ./tflint --version >> $F; else echo "tflint SKIPPED" >> $F ; fi) && \
(if [ "$TFSEC_VERSION" != "false" ]; then echo "tfsec $(./tfsec --version)" >> $F; else echo "tfsec SKIPPED" >> $F ; fi) && \
echo -e "\n\n" && cat $F && echo -e "\n\n"

@antonbabenko do you'd like to have pre-commit run on some predefined code for each hook? Or what do you mean by "smoke test"?

@antonbabenko
Copy link
Owner Author

I think the simplest optimistic smote test you refer to is a pretty accurate definition of what I meant by "smoke test" :)

@antonbabenko
Copy link
Owner Author

This issue has been resolved in version 1.63.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docker estimate/4h Need 4 hours to be done good first issue Good for newcomers
Projects
None yet
3 participants