-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from axone-protocol/ci/install-ci
Setup CI
- Loading branch information
Showing
74 changed files
with
1,247 additions
and
708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,61 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
"extends": [ | ||
"next/core-web-vitals", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"plugins": [ "@stylistic/eslint-plugin-js"], | ||
"rules": { | ||
"space-before-blocks": "error", | ||
"space-before-function-paren": "error", | ||
"@stylistic/js/indent": ["error", 2], | ||
"@stylistic/js/object-curly-spacing": ["error", "always"], | ||
"@typescript-eslint/consistent-type-definitions": ["error", "type"], | ||
"semi": ["error", "always"], | ||
"quotes": ["error", "single"], | ||
"jsx-quotes": ["error", "prefer-single"], | ||
"sort-imports": [ | ||
"error", | ||
{ | ||
"ignoreCase": true, | ||
"ignoreDeclarationSort": true | ||
} | ||
], | ||
"import/order": [ | ||
1, | ||
{ | ||
"groups": [ | ||
"external", | ||
"builtin", | ||
"internal", | ||
"sibling", | ||
"parent", | ||
"index" | ||
], | ||
"pathGroups": [ | ||
{ | ||
"pattern": "components", | ||
"group": "internal" | ||
}, | ||
{ | ||
"pattern": "common", | ||
"group": "internal" | ||
}, | ||
{ | ||
"pattern": "routes/**", | ||
"group": "internal" | ||
}, | ||
{ | ||
"pattern": "assets/**", | ||
"group": "internal", | ||
"position": "after" | ||
} | ||
], | ||
"pathGroupsExcludedImportTypes": ["internal"], | ||
"alphabetize": { | ||
"order": "asc", | ||
"caseInsensitive": true | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
reviewers: | ||
- amimart | ||
- ccamel | ||
assignees: | ||
- amimart | ||
- ccamel | ||
- package-ecosystem: npm | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
reviewers: | ||
- amimart | ||
- ccamel | ||
assignees: | ||
- amimart | ||
- ccamel | ||
open-pull-requests-limit: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Add to project | ||
|
||
on: | ||
issues: | ||
types: | ||
- opened | ||
|
||
jobs: | ||
add-to-project: | ||
name: Add issue to project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
project-url: https://github.com/orgs/axone-protocol/projects/2 | ||
github-token: ${{ secrets.OPS_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
workflow_call: | ||
|
||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: build-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup node environment (for building) | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.20' | ||
cache: yarn | ||
|
||
- name: Restore cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
.next/cache | ||
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | ||
restore-keys: | | ||
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}- | ||
- name: Fetch dependencies | ||
run: | | ||
yarn --frozen-lockfile | ||
- name: Build | ||
run: | | ||
yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Follow contributor | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
follow-user: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Follow user | ||
uses: okp4/[email protected] | ||
with: | ||
username: ${{ github.event.pull_request.user.login }} | ||
token: ${{ secrets.OPS_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
pull_request: | ||
branches: [main] | ||
|
||
workflow_call: | ||
|
||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: lint-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint-commits: | ||
runs-on: ubuntu-22.04 | ||
if: github.actor != 'dependabot[bot]' | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check commits | ||
uses: wagoid/commitlint-github-action@v5 | ||
|
||
lint-markdown: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Lint markdown files | ||
uses: avto-dev/[email protected] | ||
with: | ||
args: "**/*.md" | ||
|
||
lint-yaml: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Lint yaml files | ||
uses: ibiqlik/[email protected] | ||
|
||
lint-ts: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup node environment (for building) | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18.20" | ||
cache: yarn | ||
|
||
- name: Restore cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
.next/cache | ||
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | ||
restore-keys: | | ||
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}- | ||
- name: Fetch dependencies | ||
run: | | ||
yarn --frozen-lockfile | ||
- name: Fetch dependencies | ||
run: | | ||
yarn lint | ||
report-new-dependencies: | ||
runs-on: ubuntu-22.04 | ||
if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check for new dependencies | ||
uses: hiwelo/[email protected] | ||
with: | ||
token: ${{ secrets.OPS_TOKEN }} | ||
|
||
lint-branch-name: | ||
runs-on: ubuntu-22.04 | ||
if: github.actor != 'dependabot[bot]' && github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened') | ||
steps: | ||
- name: Check branch name conventions | ||
uses: AlbertHernandez/[email protected] | ||
with: | ||
branch_pattern: "feat|fix|build|ci|docs|style|refactor|perf|test|chore" | ||
comment_for_invalid_branch_name: | | ||
🙋 Oops! This branch name does not follow the naming convention. | ||
<hr> | ||
Please, see the following branch naming convention: | ||
Branch naming convention | Purpose | ||
------------------------ | ------- | ||
`feat/**` | A new feature | ||
`fix/**` | A bug fix | ||
`build/**` | Changes that affect the build system (npm, mavem, poetry) | ||
`ci/**` | Changes to the CI configuration | ||
`docs/**` | Documentation only changes | ||
`style/**` | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) | ||
`refactor/**` | Code changes that neither fixe a bug nor adds a feature | ||
`perf/**` | Code changes that improve performance | ||
`test/**` | When adding tests or correcting existing tests | ||
`chore/**` | Other changes that don't modify source | ||
fail_if_invalid_branch_name: "true" | ||
ignore_branch_pattern: "main" | ||
- name: Close non-compliant branch | ||
if: ${{ failure() }} | ||
uses: codelytv/no-pull-requests@v1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.OPS_TOKEN }} | ||
message: 🙅 Closing the PR because it does not respect naming conventions. Edit the branch name and submit a new PR. | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.OPS_TOKEN }} | ||
|
||
lint-image: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Lint image files | ||
run: | | ||
FAILED=0 | ||
for file in $(find "$CONTENT_FOLDER" -regextype posix-egrep -regex '.+\.(bmp|ico|jpg|jpeg|png|svg|webp)'); do | ||
type=$(identify $file | awk '{print $2}') | ||
if [[ $type =~ ^(WEBP|SVG|ICO)$ ]]; then | ||
echo "✅ $file" | ||
else | ||
>&2 echo "❌ $file incorrect. Please use only webp or svg format 🙏" | ||
FAILED=1 | ||
fi | ||
done | ||
if [ "${FAILED}" = "1" ]; then | ||
exit 1 | ||
fi | ||
env: | ||
CONTENT_FOLDER: ./public/images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
line-length: false | ||
no-hard-tabs: false | ||
no-inline-html: false | ||
first-line-h1: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extends: default | ||
rules: | ||
document-start: disable | ||
line-length: | ||
max: 160 | ||
level: warning | ||
brackets: | ||
min-spaces-inside: 0 | ||
max-spaces-inside: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.