-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore ci-infra.yml and ci-docs.yml for template repo?
- Loading branch information
Showing
2 changed files
with
108 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: CI Documentation Checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
lint-markdown: | ||
name: Lint markdown | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# This is the GitHub Actions-friendly port of the linter used in the Makefile. | ||
- uses: gaurav-nelson/[email protected] | ||
with: | ||
use-quiet-mode: "yes" # errors only. | ||
config-file: ".github/workflows/markdownlint-config.json" |
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,89 @@ | ||
name: CI Infra Checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- bin/** | ||
- infra/** | ||
- .github/workflows/** | ||
pull_request: | ||
paths: | ||
- bin/** | ||
- infra/** | ||
- .github/workflows/** | ||
|
||
jobs: | ||
lint-github-actions: | ||
# Lint github actions files using https://github.com/rhysd/actionlint | ||
# This job configuration is largely copied from https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions | ||
name: Lint GitHub Actions workflows | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download actionlint | ||
id: get_actionlint | ||
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) | ||
shell: bash | ||
- name: Check workflow files | ||
run: ${{ steps.get_actionlint.outputs.executable }} -color | ||
shell: bash | ||
lint-scripts: | ||
name: Lint scripts | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Shellcheck | ||
run: make infra-lint-scripts | ||
check-terraform-format: | ||
name: Check Terraform format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup-terraform | ||
- name: Run infra-lint-terraform | ||
run: | | ||
echo "If this fails, run 'make infra-format'" | ||
make infra-lint-terraform | ||
validate-terraform: | ||
name: Validate Terraform modules | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup-terraform | ||
- name: Validate | ||
run: make infra-validate-modules | ||
check-compliance-with-checkov: | ||
name: Check compliance with checkov | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Run Checkov check | ||
# Pin to specific checkov version rather than running from checkov@master | ||
# since checkov frequently adds new checks that can cause CI checks to fail unpredictably. | ||
# There is currently no way to specify the checkov version to pin to (See https://github.com/bridgecrewio/checkov-action/issues/41) | ||
# so we need to pin the version of the checkov-action, which indirectly pins the checkov version. | ||
# In this case, checkov-action v12.2296.0 is mapped to checkov v2.3.194. | ||
uses: bridgecrewio/[email protected] | ||
with: | ||
directory: infra | ||
framework: terraform | ||
quiet: true # only displays failed checks | ||
check-compliance-with-tfsec: | ||
name: Check compliance with tfsec | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run tfsec check | ||
uses: aquasecurity/[email protected] | ||
with: | ||
github_token: ${{ github.token }} |