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 e8f1062 commit da9f218
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 40 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
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
Expand Down
13 changes: 2 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,11 @@ 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
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: trunk-io/trunk-action@v1
golangci-lint:
if: >
(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip workflows')) ||
github.event_name == 'push'
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: golangci/golangci-lint-action@v4
28 changes: 28 additions & 0 deletions .github/workflows/trunk_upgrade.yaml
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
68 changes: 47 additions & 21 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,59 @@
# 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: 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:
disabled:
- golangci-lint # This currently fails to lint files that use cgo.
definitions:
# We only add CGO_ENABLED=1, everything else is inherited from the default linter configuration.
- name: golangci-lint
environment:
- name: GOLANGCI_LINT_CACHE
value: ${cachedir}
- name: PATH
list:
- ${env.PATH}
- name: GO111MODULE
value: auto
- name: SSH_AUTH_SOCK
optional: true
value: ${env.SSH_AUTH_SOCK}
- name: CGO_ENABLED
value: "1"
enabled:
- [email protected]
- [email protected]
- [email protected]
- git-diff-check@SYSTEM
- [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]
ignore:
- linters:
- markdownlint
paths:
- LICENSE.md
- CHANGELOG.md
- LICENSE.md
actions:
enabled:
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
- trunk-upgrade-available
plugins:
sources:
- id: trunk
ref: v0.0.14
uri: https://github.com/trunk-io/plugins
runtimes:
enabled:
- [email protected]
- [email protected]
- [email protected]
1 change: 1 addition & 0 deletions internal/pkg/eventhandler/fnkeyhandler.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package eventhandler encapsulates logic to handle keyboard events.
package eventhandler

import (
Expand Down

0 comments on commit da9f218

Please sign in to comment.