Skip to content

Commit

Permalink
Merge branch 'main' into simplify-build
Browse files Browse the repository at this point in the history
* main:
  Group log output on GitHub Actions (#4961)
  Reduce duplication in CI and CD workflows (#4982)
  Move instructions from the wiki to docs (#4957)
  Update documentation (#4981)
  Bump com.puppycrawl.tools:checkstyle in /dependencies/checkstyle (#4966)
  Bump isort from 5.12.0 to 5.13.0 in /dependencies/python (#4967)
  Bump pylint from 3.0.2 to 3.0.3 in /dependencies/python (#4968)
  Bump cfn-lint from 0.83.3 to 0.83.4 in /dependencies/python (#4969)
  Bump npm-groovy-lint from 13.0.0 to 13.0.2 in /dependencies (#4970)
  Bump typescript from 5.3.2 to 5.3.3 in /dependencies (#4972)
  Bump next from 14.0.3 to 14.0.4 in /dependencies (#4973)
  Bump react-redux from 9.0.1 to 9.0.3 in /dependencies (#4974)
  Bump renovate from 37.83.5 to 37.89.7 in /dependencies (#4975)
  Bump prettier from 3.1.0 to 3.1.1 in /dependencies (#4976)
  Bump stylelint-scss from 5.3.1 to 5.3.2 in /dependencies (#4977)
  Bump golang from 1.21.4-alpine to 1.21.5-alpine (#4978)
  Bump actions/stale from 8 to 9 (#4980)
  • Loading branch information
ferrarimarco committed Dec 12, 2023
2 parents 9bc3abf + 7150e1f commit 2fa788a
Show file tree
Hide file tree
Showing 29 changed files with 601 additions and 817 deletions.
65 changes: 13 additions & 52 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,28 @@
# Contributing

:wave: Hi there!
We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.

## Submitting a pull request

[Pull Requests][pulls] are used for adding new playbooks, roles, and documents to the repository, or editing the existing ones.

**With write access**

1. Clone the repository (only if you have write access)
1. Create a new branch: `git checkout -b my-branch-name`
1. Make your change
1. Push and [submit a pull request][pr]
1. Pat yourself on the back and wait for your pull request to be reviewed and merged.

**Without write access**

1. [Fork][fork] and clone the repository
1. Create a new branch: `git checkout -b my-branch-name`
1. Make your change
1. Push to your fork and [submit a pull request][pr]
1. Pat your self on the back and wait for your pull request to be reviewed and merged.

Here are a few things you can do that will increase the likelihood of your pull request being accepted:
We're thrilled that you'd like to contribute to this project.
Your help is essential for keeping it great.

- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
- Write [good commit messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).

Draft pull requests are also welcome to get feedback early on, or if there is something blocking you.

- Create a branch with a name that identifies the user and nature of the changes (similar to `user/branch-purpose`)
- Open a pull request

### CI/CT/CD

The **Super-Linter** has _CI/CT/CD_ configured utilizing **GitHub** Actions.
## Submitting a pull request

- When a branch is created and code is pushed, a **GitHub** Action is triggered for building the new **Docker** container with the new codebase
- The **Docker** container is then ran against the _test cases_ to validate all code sanity
- `.automation/test` contains all test cases for each language that should be validated
- These **GitHub** Actions utilize the Checks API and Protected Branches to help follow the SDLC
- When the Pull Request is merged to main, the **Super-Linter** **Docker** container is then updated and deployed with the new codebase
- **Note:** The branch's **Docker** container is also removed from **DockerHub** to cleanup after itself
We use [pull requests](https://github.com/super-linter/super-linter/pulls) to
contribute new features, fixes, or documentation.

## Releasing
Here are a few things you can do that will increase the likelihood of your pull
request being accepted:

If you are the current maintainer of this action you can create releases from the `Release` page of the repository.
- Keep your change as focused as possible. If there are multiple changes you
would like to make that are not dependent upon each other, submit them as
separate pull requests.
- Write [descriptive commit messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).

- It will notify the issue it has seen the information and starts the Actions job
- It will create a branch and update the `actions.yml` with the new version supplied to the issue
- It will then create a PR with the updated code
- It will then create the build the artifacts needed
- it will then publish the release and merge the PR
- A GitHub Action will Publish the Docker image to GitHub Package Registry once a Release is created
- A GitHub Action will Publish the Docker image to Docker Hub once a Release is created
Draft pull requests are also welcome to get feedback early on, or if there is
something blocking you.

## Resources

- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
- [Using Pull Requests](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
- [GitHub Help](https://docs.github.com/en)

[pulls]: https://github.com/super-linter/super-linter/pulls
[pr]: https://github.com/super-linter/super-linter/compare
[fork]: https://github.com/super-linter/super-linter/fork
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
value: |
Thanks for taking the time to fill out this feature request!
If this is a request to add a new language, after submitting this issue
check out [the wiki](https://github.com/super-linter/super-linter/wiki/Adding-new-language-support-to-Super-Linter)
check out [the instructions](https://github.com/super-linter/super-linter/blob/main/docs/add-new-linter.md)
for more information on how to accomplish that.
- type: checkboxes
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/linters/.sqlfluff
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## This /.sqlfluff file can be used to configure the SQLFluff linter when
## used via the GitHub Super Linter. Copy it to the .github/linters folder of
## used via the Super Linter. Copy it to the .github/linters folder of
## your repo, and uncomment the necessary lines to configure the Super Linter.
##
## IMPORTANT NOTE: The GitHub Super Linter configuration file for SQLFluff
## IMPORTANT NOTE: The Super Linter configuration file for SQLFluff
## supersedes any local configuration files you might have in within your
## codebase. For this reason it should only be used when you want the same
## configuration for your entire code base. If you need different configuration
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,6 @@ jobs:
- name: Run Test Suite
run: make test

- name: Run Super-Linter Tests
run: |
docker run \
-e RUN_LOCAL=true \
-e TEST_CASE_RUN=true \
-e ANSIBLE_DIRECTORY=.automation/test/ansible \
-e ACTIONS_RUNNER_DEBUG=true \
-e DEFAULT_BRANCH=main \
-e RENOVATE_SHAREABLE_CONFIG_PRESET_FILE_NAMES="default.json,hoge.json" \
-e ERROR_ON_MISSING_EXEC_BIT=true \
-e TYPESCRIPT_STANDARD_TSCONFIG_FILE=".github/linters/tsconfig.json" \
-v "${GITHUB_WORKSPACE}:/tmp/lint" \
"${CONTAINER_IMAGE_ID}"
- name: Lint Entire Codebase
run: |
docker run \
-e RUN_LOCAL=true \
-e OUTPUT_DETAILS=detailed \
-e ACTIONS_RUNNER_DEBUG=true \
-e DEFAULT_BRANCH=main \
-e RENOVATE_SHAREABLE_CONFIG_PRESET_FILE_NAMES="default.json,hoge.json" \
-e ERROR_ON_MISSING_EXEC_BIT=true \
-v "${GITHUB_WORKSPACE}:/tmp/lint" \
"${CONTAINER_IMAGE_ID}"
- name: Login to GHCR
uses: docker/login-action@v3.0.0
with:
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,3 @@ jobs:
- name: Run Test Suite
run: make test

- name: Run Super-Linter Tests
run: |
docker run \
-e RUN_LOCAL=true \
-e TEST_CASE_RUN=true \
-e ANSIBLE_DIRECTORY=.automation/test/ansible \
-e ACTIONS_RUNNER_DEBUG=true \
-e DEFAULT_BRANCH=main \
-e RENOVATE_SHAREABLE_CONFIG_PRESET_FILE_NAMES="default.json,hoge.json" \
-e ERROR_ON_MISSING_EXEC_BIT=true \
-e TYPESCRIPT_STANDARD_TSCONFIG_FILE=".github/linters/tsconfig.json" \
-v "${GITHUB_WORKSPACE}:/tmp/lint" \
"${CONTAINER_IMAGE_ID}"
- name: Lint Entire Codebase
run: |
docker run \
-e RUN_LOCAL=true \
-e ACTIONS_RUNNER_DEBUG=true \
-e DEFAULT_BRANCH=main \
-e RENOVATE_SHAREABLE_CONFIG_PRESET_FILE_NAMES="default.json,hoge.json" \
-e ERROR_ON_MISSING_EXEC_BIT=true \
-v "${GITHUB_WORKSPACE}:/tmp/lint" \
"${CONTAINER_IMAGE_ID}"
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
timeout-minutes: 60
steps:
- name: Mark issue stale
uses: actions/stale@v8
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "This issue has been automatically marked as stale because it has not had recent activity.\nIt will be closed in 14 days if no further activity occurs.\nThank you for your contributions.\n\nIf you think this issue should stay open, please remove the `O: stale 🤖` label or comment on the issue.\n\nIf you're a maintainer, you can stop the bot to mark this issue as stale in the future by adding the `O: backlog 🤖` label`."
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,11 @@ super-linter.report

# Test reports
test/reports

# Developer credentials
.github-personal-access-token

# Test leftovers
.lintr
.automation/test/rust_clippy/**/Cargo.lock
.automation/test/rust_clippy/**/target/**
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FROM dotenvlinter/dotenv-linter:3.3.0 as dotenv-linter
FROM ghcr.io/awkbar-devops/clang-format:v1.0.2 as clang-format
FROM ghcr.io/terraform-linters/tflint-bundle:v0.48.0.0 as tflint
FROM ghcr.io/yannh/kubeconform:v0.6.4 as kubeconfrm
FROM golang:1.21.4-alpine as golang
FROM golang:1.21.5-alpine as golang
FROM golangci/golangci-lint:v1.55.2 as golangci-lint
FROM hadolint/hadolint:latest-alpine as dockerfile-lint
FROM hashicorp/terraform:1.6.5 as terraform
Expand Down
36 changes: 33 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
all: info docker test ## Run all targets.

.PHONY: test
test: info validate-container-image-labels inspec test-find ## Run tests
test: info validate-container-image-labels inspec lint-codebase test-find test-linters ## Run the test suite

# if this session isn't interactive, then we don't want to allocate a
# TTY, which would fail, but if it is interactive, we do want to attach
Expand Down Expand Up @@ -63,6 +63,8 @@ ifeq ($(BUILD_VERSION),)
BUILD_VERSION := $(shell git rev-parse HEAD)
endif

GITHUB_TOKEN_PATH := "$(CURDIR)/.github-personal-access-token"

.PHONY: inspec
inspec: inspec-check ## Run InSpec tests
DOCKER_CONTAINER_STATE="$$(docker inspect --format "{{.State.Running}}" $(SUPER_LINTER_TEST_CONTAINER_NAME) 2>/dev/null || echo "")"; \
Expand All @@ -85,12 +87,12 @@ inspec: inspec-check ## Run InSpec tests

.phony: docker
docker: ## Build the container image
@if [ -z "${GITHUB_TOKEN}" ]; then echo "GITHUB_TOKEN environment variable not set. Please set your GitHub Personal Access Token."; exit 1; fi
@if [ ! -f "${GITHUB_TOKEN_PATH}" ]; then echo "Cannot find the file to load the GitHub access token: $(GITHUB_TOKEN_PATH). Create a readable file there, and populate it with a GitHub personal access token."; exit 1; fi
DOCKER_BUILDKIT=1 docker buildx build --load \
--build-arg BUILD_DATE=$(BUILD_DATE) \
--build-arg BUILD_REVISION=$(BUILD_REVISION) \
--build-arg BUILD_VERSION=$(BUILD_VERSION) \
--secret id=GITHUB_TOKEN,env=GITHUB_TOKEN \
--secret id=GITHUB_TOKEN,src=$(GITHUB_TOKEN_PATH) \
-t $(SUPER_LINTER_TEST_CONTAINER_URL) .

.phony: docker-pull
Expand All @@ -111,7 +113,35 @@ test-find: ## Run super-linter on a subdirectory with USE_FIND_ALGORITHM=true
-e RUN_LOCAL=true \
-e ACTIONS_RUNNER_DEBUG=true \
-e ERROR_ON_MISSING_EXEC_BIT=true \
-e ENABLE_GITHUB_ACTIONS_GROUP_TITLE=true \
-e DEFAULT_BRANCH=main \
-e USE_FIND_ALGORITHM=true \
-v "$(CURDIR)/.github":/tmp/lint \
$(SUPER_LINTER_TEST_CONTAINER_URL)

.phony: lint-codebase
lint-codebase: ## Lint the entire codebase
docker run \
-e RUN_LOCAL=true \
-e ACTIONS_RUNNER_DEBUG=true \
-e DEFAULT_BRANCH=main \
-e ENABLE_GITHUB_ACTIONS_GROUP_TITLE=true \
-e ERROR_ON_MISSING_EXEC_BIT=true \
-e RENOVATE_SHAREABLE_CONFIG_PRESET_FILE_NAMES="default.json,hoge.json" \
-v "$(CURDIR):/tmp/lint" \
$(SUPER_LINTER_TEST_CONTAINER_URL)

.phony: test-linters
test-linters: ## Run the linters test suite
docker run \
-e ACTIONS_RUNNER_DEBUG=true \
-e ANSIBLE_DIRECTORY=.automation/test/ansible \
-e DEFAULT_BRANCH=main \
-e ENABLE_GITHUB_ACTIONS_GROUP_TITLE=true \
-e ERROR_ON_MISSING_EXEC_BIT=true \
-e RENOVATE_SHAREABLE_CONFIG_PRESET_FILE_NAMES="default.json,hoge.json" \
-e RUN_LOCAL=true \
-e TEST_CASE_RUN=true \
-e TYPESCRIPT_STANDARD_TSCONFIG_FILE=".github/linters/tsconfig.json" \
-v "$(CURDIR):/tmp/lint" \
$(SUPER_LINTER_TEST_CONTAINER_URL)

0 comments on commit 2fa788a

Please sign in to comment.