chore: add prettier/typo check to CI (#14)
## Changes made - Added back CI steps for validating the codebase for typos and formatting - Updated README validation CI step to be dependent on typo-checking step - Updated configuration files as needed to support the new CI step - Updated all files that were previously getting skipped over from improperly-set-up CI logic
This commit is contained in:
parent
0ce1e7ab01
commit
9e18a4e3a8
4
.github/typos.toml
vendored
Normal file
4
.github/typos.toml
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[default.extend-words]
|
||||||
|
muc = "muc" # For Munich location code
|
||||||
|
Hashi = "Hashi"
|
||||||
|
HashiCorp = "HashiCorp"
|
||||||
52
.github/workflows/ci.yaml
vendored
52
.github/workflows/ci.yaml
vendored
@ -7,20 +7,8 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||||
jobs:
|
jobs:
|
||||||
validate-readme-files:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check out code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: "1.23.2"
|
|
||||||
- name: Validate contributors
|
|
||||||
run: go build ./scripts/contributors && ./contributors
|
|
||||||
- name: Remove build file artifact
|
|
||||||
run: rm ./contributors
|
|
||||||
test-terraform:
|
test-terraform:
|
||||||
|
name: Validate Terraform output
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
@ -42,3 +30,41 @@ jobs:
|
|||||||
run: bun test
|
run: bun test
|
||||||
- name: Run Terraform Validate
|
- name: Run Terraform Validate
|
||||||
run: bun terraform-validate
|
run: bun terraform-validate
|
||||||
|
validate-style:
|
||||||
|
name: Check for typos and unformatted code
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Install Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
# Need Terraform for its formatter
|
||||||
|
- name: Install Terraform
|
||||||
|
uses: coder/coder/.github/actions/setup-tf@main
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install
|
||||||
|
- name: Validate formatting
|
||||||
|
run: bun fmt:ci
|
||||||
|
- name: Check for typos
|
||||||
|
uses: crate-ci/typos@v1.31.1
|
||||||
|
with:
|
||||||
|
config: .github/typos.toml
|
||||||
|
validate-readme-files:
|
||||||
|
name: Validate README files
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# We want to do some basic README checks first before we try analyzing the
|
||||||
|
# contents
|
||||||
|
needs: validate-style
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.23.2"
|
||||||
|
- name: Validate contributors
|
||||||
|
run: go build ./scripts/contributors && ./contributors
|
||||||
|
- name: Remove build file artifact
|
||||||
|
run: rm ./contributors
|
||||||
|
|||||||
@ -11,10 +11,10 @@ BOLD='\033[0;1m'
|
|||||||
printf "$${BOLD}Installing MODULE_NAME ...\n\n"
|
printf "$${BOLD}Installing MODULE_NAME ...\n\n"
|
||||||
|
|
||||||
# Add code here
|
# Add code here
|
||||||
# Use varibles from the templatefile function in main.tf
|
# Use variables from the templatefile function in main.tf
|
||||||
# e.g. LOG_PATH, PORT, etc.
|
# e.g. LOG_PATH, PORT, etc.
|
||||||
|
|
||||||
printf "🥳 Installation comlete!\n\n"
|
printf "🥳 Installation complete!\n\n"
|
||||||
|
|
||||||
printf "👷 Starting MODULE_NAME in background...\n\n"
|
printf "👷 Starting MODULE_NAME in background...\n\n"
|
||||||
# Start the app in here
|
# Start the app in here
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "modules",
|
"name": "modules",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "bun test",
|
"fmt": "bun x prettier --write **/*.sh **/*.ts **/*.md *.md && terraform fmt -recursive -diff",
|
||||||
|
"fmt:ci": "bun x prettier --check **/*.sh **/*.ts **/*.md *.md && terraform fmt -check -recursive -diff",
|
||||||
"terraform-validate": "./scripts/terraform_validate.sh",
|
"terraform-validate": "./scripts/terraform_validate.sh",
|
||||||
"fmt": "bun x prettier -w **/*.sh .sample/run.sh new.sh **/*.ts **/*.md *.md && terraform fmt **/*.tf .sample/main.tf",
|
"test": "bun test",
|
||||||
"fmt:ci": "bun x prettier --check **/*.sh .sample/run.sh new.sh **/*.ts **/*.md *.md && terraform fmt -check **/*.tf .sample/main.tf"
|
"update-version": "./update-version.sh"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bun": "^1.2.9",
|
"@types/bun": "^1.2.9",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user