Skip to content

Commit

Permalink
Merge pull request #40 from foomo/schema-2.0
Browse files Browse the repository at this point in the history
Schema 2.0
  • Loading branch information
franklinkim authored Jul 1, 2024
2 parents 8a2af62 + 2d8210b commit 4198668
Show file tree
Hide file tree
Showing 159 changed files with 3,419 additions and 2,762 deletions.
17 changes: 6 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/"
interval: weekly
- package-ecosystem: gomod
directory: '/'
schedule:
interval: "weekly"
interval: weekly
39 changes: 39 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: checks

on:
push:
branches: [ main ]
pull_request:
merge_group:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: golangci/golangci-lint-action@v4
with:
version: latest

- name: Run tests
run: make test
env:
SHELL: "/bin/zsh"

- uses: coverallsapp/github-action@v2
with:
file: coverage.out
34 changes: 0 additions & 34 deletions .github/workflows/release.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release Tag

on:
push:
tags:
- v*.*.*
workflow_dispatch:

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Unshallow
run: git fetch --prune --unshallow

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- id: app_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.TOKEN_APP_ID }}
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}

- uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
32 changes: 0 additions & 32 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
!.golangci.yml
!.goreleaser.yml
!.husky.yaml
!.yamllint.yaml
/bin/
/coverage.out
/coverage.html
Expand Down
17 changes: 14 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
run:
timeout: 5m
skip-dirs:
- tmp

linters-settings:
gocritic:
disabled-checks:
- ifElseChain
- commentFormatting
gosec:
excludes:
- G204

linters:
enable:
Expand All @@ -17,12 +28,12 @@ linters:
- forcetypeassert # finds forced type assertions [fast: true, auto-fix: false]
#- gochecknoinits # Checks that no init functions are present in Go code [fast: true, auto-fix: false]
#- goconst # Finds repeated strings that could be replaced by a constant [fast: true, auto-fix: false]
#- gocritic # Provides diagnostics that check for bugs, performance and style issues. [fast: false, auto-fix: false]
- gocritic # Provides diagnostics that check for bugs, performance and style issues. [fast: false, auto-fix: false]
- goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt. [fast: true, auto-fix: true]
#- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. [fast: true, auto-fix: false]
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. [fast: true, auto-fix: false]
- goprintffuncname # Checks that printf-like functions are named with `f` at the end [fast: true, auto-fix: false]
#- gosec # (gas): Inspects source code for security problems [fast: false, auto-fix: false]
- gosec # (gas): Inspects source code for security problems [fast: false, auto-fix: false]
- grouper # An analyzer to analyze expression groups. [fast: true, auto-fix: false]
- importas # Enforces consistent import aliases [fast: false, auto-fix: false]
- maintidx # maintidx measures the maintainability index of each function. [fast: true, auto-fix: false]
Expand All @@ -31,7 +42,7 @@ linters:
- nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false]
#- nestif # Reports deeply nested if statements [fast: true, auto-fix: false]
- nilerr # Finds the code that returns nil even if it checks that the error is not nil. [fast: false, auto-fix: false]
#- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value. [fast: false, auto-fix: false]
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value. [fast: false, auto-fix: false]
- noctx # noctx finds sending http request without context.Context [fast: false, auto-fix: false]
- nolintlint # Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false]
#- nonamedreturns # Reports all named returns [fast: false, auto-fix: false]
Expand Down
61 changes: 21 additions & 40 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# .goreleaser.yml
# Build customization
project_name: squadron

release:
github:
owner: foomo
name: squadron
prerelease: auto

builds:
- binary: squadron
main: ./cmd/main.go
env:
- CGO_ENABLED=0
goos:
- windows
- darwin
Expand All @@ -13,55 +16,33 @@ builds:
- amd64
- arm64
goarm:
- 7
- '7'
env:
- CGO_ENABLED=0
main: ./cmd/main.go
flags:
- -trimpath
ldflags:
- -s -w -X github.com/foomo/squadron/cmd/actions.version={{.Version}}
ldflags: -s -w -X github.com/foomo/squadron/cmd/actions.version={{.Version}}

archives:
- format: tar.gz
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md

changelog:
filters:
exclude:
- "^wip"
- "^test"
- "^docs"
- "^chore"
- "^style"
- "go mod tidy"
- "merge conflict"
- "Merge pull request"
- "Merge remote-tracking branch"
- "Merge branch"
groups:
- title: Features
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 0
- title: Dependency updates
regexp: '^.*?(feat|fix)\(deps\)!?:.+$'
order: 100
- title: "Bug fixes"
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 150
- title: "Security"
regexp: '^.*?sec(\([[:word:]]+\))??!?:.+$'
order: 200
- title: "Performace"
regexp: '^.*?perf(\([[:word:]]+\))??!?:.+$'
order: 250
- title: Other
order: 999
use: github-native

brews:
# Repository to push the tap to.
- tap:
- repository:
owner: foomo
name: homebrew-squadron
name: homebrew-tap
caveats: "squadron -h"
homepage: "https://github.com/foomo/squadron"
description: "CLI utility manage infrastructure as code with helm"
test: |
system "#{bin}/squadron --version"
8 changes: 8 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: default

rules:
line-length: disable
document-start: disable
quoted-strings:
quote-type: single
required: false
19 changes: 5 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

## === Tasks ===

## === Tasks ===

.PHONY: doc
## Run tests
doc:
Expand All @@ -29,19 +27,12 @@ doc:
.PHONY: test
## Run tests
test:
@go test -v ./...
@go test -coverprofile=coverage.out -race -json ./... | gotestfmt

.PHONY: test.update
## Run tests and update snapshots
test.update:
go test -update ./...

.PHONY: test.cover
## Run tests with coverage
test.cover:
@go test -v -coverprofile=coverage.out ./...
@go tool cover -func=coverage.out
@go tool cover -html=coverage.out
@go test -update -coverprofile=coverage.out -race -json ./... | gotestfmt

.PHONY: lint
## Run linter
Expand All @@ -65,12 +56,12 @@ outdated:

## Install binary
install:
go build -o ${GOPATH}/bin/squadron cmd/main.go
@go build -o ${GOPATH}/bin/squadron cmd/main.go

## Build binary
build:
mkdir -p bin
go build -o bin/squadron cmd/main.go
@mkdir -p bin
@go build -o bin/squadron cmd/main.go

## === Utils ===

Expand Down
Loading

0 comments on commit 4198668

Please sign in to comment.