Skip to content

Commit

Permalink
ci: setup GH CO, WF, renovate, & Rome
Browse files Browse the repository at this point in the history
  • Loading branch information
elijaholmos committed Mar 23, 2023
1 parent 3d33374 commit abc04b1
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @elijaholmos
21 changes: 21 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["elijaholmos/.github:renovate-config"],
"packageRules": [
{
"matchPackagePatterns": ["nomic"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "Nomic dependencies"
},
{
"matchPackagePatterns": ["ethers"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "Ethers dependencies"
},
{
"matchPackagePatterns": ["typechain"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "Typechain dependencies"
}
]
}
48 changes: 48 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Code Style
on:
pull_request:
branches: [master]
paths: ['**.js', '**.ts']

env:
# version should be in sync w package.json
ROME_VERSION: 11.0.0

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Rome
uses: rome/setup-rome@main
with:
version: ${{ env.ROME_VERSION }}

- name: Check Rome Version
run: rome version

- name: Run Linter
# specific flag is required per https://github.com/rome/tools/discussions/3925#discussioncomment-4310702
run: rome ci --formatter-enabled=false .

format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Rome
uses: rome/setup-rome@main
with:
version: ${{ env.ROME_VERSION }}

- name: Check Rome Version
run: rome version

- name: Run Formatter
# specific flag is required per https://github.com/rome/tools/discussions/3925#discussioncomment-4310702
run: rome ci --linter-enabled=false .
24 changes: 24 additions & 0 deletions .github/workflows/detect-duplicate-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: detect-duplicate-actions

on:
workflow_call:
outputs:
should_skip:
description: 'Returns "true" if the current run should be skipped'
value: ${{ jobs.detect-duplicate-actions.outputs.should_skip }}

jobs:
detect-duplicate-actions:
name: detect-duplicate-actions
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- name: Detect Duplicate
id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule"]'
cancel_others: 'true'
concurrent_skipping: 'same_content'
29 changes: 29 additions & 0 deletions rome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "./node_modules/rome/configuration_schema.json",
"files": {
"ignore": ["./node_modules/**/*", "./dist/**/*", "./public/**/*", "typings.ts"]
},
"formatter": {
"indentStyle": "tab",
"indentSize": 4,
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"linter": {
"rules": {
"complexity": {
"noExtraBooleanCast": "off"
},
"performance": {
"noDelete": "off"
},
"suspicious": {
"noExplicitAny": "warn"
}
}
}
}

0 comments on commit abc04b1

Please sign in to comment.