Skip to content

Commit

Permalink
ci: improve trunk flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Serpentiel committed Feb 28, 2024
1 parent 5a02742 commit a0b894e
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 507 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CodeQL

on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
push:
branches:
- main

permissions:
actions: read
contents: read
security-events: write

jobs:
codeql:
runs-on: ubuntu-latest
if: >
(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip workflows')) ||
github.event_name == 'push'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: github/codeql-action/init@v3
with:
languages: go
- uses: github/codeql-action/autobuild@v3
- uses: github/codeql-action/analyze@v3
2 changes: 2 additions & 0 deletions .github/workflows/dependency_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ jobs:
github.event_name == 'push'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/dependency-review-action@v4
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ jobs:
(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip workflows')) ||
github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/trunk_upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Upgrade Trunk

on:
schedule:
- cron: 0 8 * * 1-5
workflow_dispatch: {}

permissions: read-all

jobs:
trunk-upgrade:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: trunk-io/trunk-action/upgrade@v1
with:
prefix: "ci(deps): "
lowercase-title: true
8 changes: 0 additions & 8 deletions .markdownlint.json

This file was deleted.

2 changes: 2 additions & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
tmp
File renamed without changes.
5 changes: 5 additions & 0 deletions .trunk/configs/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
default: true
MD013:
line_length: 120
code_blocks: false
tables: false
41 changes: 25 additions & 16 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.7.0
version: 1.20.1
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v0.0.14
ref: v1.4.3
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
enabled:
- [email protected]
- [email protected]
- [email protected]
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
enabled:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- git-diff-check
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
ignore:
- linters: [markdownlint]
- linters:
- markdownlint
paths:
- .github/**
- LICENSE.md
- CHANGELOG.md
runtimes:
enabled:
- [email protected]
- [email protected]
- [email protected]
- LICENSE.md
actions:
enabled:
- trunk-announce
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// rootCmd is the rootCmd command for the application.
var rootCmd = &cobra.Command{
Use: "go-cli",
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
fx.New(
fx.Supply(cmd),

Expand Down
35 changes: 19 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
module github.com/Serpentiel/go-cli

go 1.19
go 1.21

require go.uber.org/zap v1.24.0
require go.uber.org/zap v1.27.0

require (
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
go.uber.org/dig v1.16.1 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/dig v1.17.1 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
github.com/spf13/cobra v1.6.1
github.com/spf13/viper v1.15.0
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/fx v1.19.1
go.uber.org/multierr v1.9.0 // indirect
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/fx v1.20.1
go.uber.org/multierr v1.11.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1
)
Loading

0 comments on commit a0b894e

Please sign in to comment.