Skip to content

Commit 0fd4f42

Browse files
authored
Basic CI Flows (#115)
* feat: add Trunk CI configuration and related files * try post linter annotations * fix formatting * add pre-commit-check * adjust permissions * remove stages * update pre-commit version * adjust formatting
1 parent d0c72e2 commit 0fd4f42

File tree

77 files changed

+618
-810
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+618
-810
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222
"esbenp.prettier-vscode",
2323
"streetsidesoftware.code-spell-checker",
2424
"ms-vscode.remote-explorer",
25-
"usernamehw.errorlens"
25+
"usernamehw.errorlens",
26+
"Trunk.io"
2627
]
2728
}
2829
},
29-
"forwardPorts": [
30-
3000
31-
],
30+
"forwardPorts": [3000],
3231
"containerUser": "vscode",
33-
"postCreateCommand": "yarn install",
32+
"postCreateCommand": "yarn install && curl -fsSL https://get.trunk.io -o install.sh && chmod +x install.sh && ./install.sh",
3433
"waitFor": "postCreateCommand", // otherwise automated jest tests fail
3534
"features": {
3635
"node": {

.github/workflows/pre-commit.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Lint Check (pre-commit)
2+
3+
permissions:
4+
contents: read
5+
checks: write
6+
issues: write
7+
pull-requests: write
8+
9+
on: [push]
10+
11+
jobs:
12+
pre-commit:
13+
uses: bemanproject/infra-workflows/.github/workflows/[email protected]

.github/workflows/trunk-check.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Trunk Check
2+
on: [push, pull_request, workflow_dispatch]
3+
concurrency:
4+
group: ${{ github.head_ref || github.run_id }}
5+
cancel-in-progress: true
6+
7+
permissions: read-all
8+
9+
jobs:
10+
trunk_check:
11+
name: Trunk Check Runner
12+
runs-on: ubuntu-latest
13+
permissions:
14+
checks: write # For trunk to post annotations
15+
contents: read # For repo checkout
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: true
22+
23+
- name: Trunk Check
24+
uses: trunk-io/trunk-action@v1
25+
with:
26+
check-mode: all
27+
post-annotations: true

.pre-commit-config.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
10+
- repo: https://github.com/psf/black
11+
rev: 23.9.1 # Use the latest stable version
12+
hooks:
13+
- id: black
14+
15+
- repo: https://github.com/pre-commit/mirrors-eslint
16+
rev: v8.50.0 # Use the latest stable version
17+
hooks:
18+
- id: eslint
19+
20+
- repo: https://github.com/pre-commit/mirrors-prettier
21+
rev: v3.0.0 # Use the latest stable version
22+
hooks:
23+
- id: prettier
24+
25+
- repo: https://github.com/markdownlint/markdownlint
26+
rev: v0.12.0 # Use the latest stable version
27+
hooks:
28+
- id: markdownlint
29+
30+
- repo: https://github.com/zricethezav/gitleaks
31+
rev: v8.17.0 # Use the latest stable version
32+
hooks:
33+
- id: gitleaks
34+
35+
exclude: |
36+
^static/.*
37+
^node_modules/.*

.trunk/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*out
2+
*logs
3+
*actions
4+
*notifications
5+
*tools
6+
plugins
7+
user_trunk.yaml
8+
user.yaml
9+
tmp

.trunk/configs/.isort.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[settings]
2+
profile=black

.trunk/configs/.markdownlint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Prettier friendly markdownlint config (all formatting rules disabled)
2+
extends: markdownlint/style/prettier

.trunk/configs/.shellcheckrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
enable=all
2+
source-path=SCRIPTDIR
3+
disable=SC2154
4+
5+
# If you're having issues with shellcheck following source, disable the errors via:
6+
# disable=SC1090
7+
# disable=SC1091

.trunk/configs/.yamllint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rules:
2+
quoted-strings:
3+
required: only-when-needed
4+
extra-allowed: ["{|}"]
5+
key-duplicates: {}
6+
octal-values:
7+
forbid-implicit-octal: true

.trunk/configs/ruff.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Generic, formatter-friendly config.
2+
select = ["B", "D3", "E", "F"]
3+
4+
# Never enforce `E501` (line length violations). This should be handled by formatters.
5+
ignore = ["E501"]

0 commit comments

Comments
 (0)