Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tools/avatar-platform] feat: initialize project structure #1

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/buildConfiguration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
builds:
- name: Avatar Platform
path: tools/avatar-platform

customBuilds:
- name: Nightly Job
jobName: nightlyJob
scriptPath: .github/jenkinsfile/nightlyBuild.groovy
triggers:
- type: cron
schedule: '@midnight'
25 changes: 25 additions & 0 deletions .github/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Setting coverage targets per flag
# Each project represent a package which has one flag
coverage:
status:
project:
default:
target: 95% # overall project / repo coverage

avatar-platform:
target: auto
threshold: 1%
flags:
- avatar-platform

# New root YAML section = `flags:`
# This is where you would define every flag from your
# uploader, and update when new Flags added
# Each flag is used to represent each package in the
# monorepo. This allows code coverage per package.

flags:
avatar-platform:
paths:
- tools/avatar-platform
carryforward: true
36 changes: 36 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 2
updates:

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: sunday
target-branch: dev
commit-message:
prefix: '[dependency]'
groups:
github-action-dependencies:
patterns:
- '*'
update-types:
- minor
- patch

- package-ecosystem: npm
directories:
- /tools/avatar-platform
schedule:
interval: weekly
day: sunday
target-branch: dev
versioning-strategy: increase-if-necessary
commit-message:
prefix: '[dependency]'
groups:
npm-dependencies:
patterns:
- '*'
update-types:
- minor
- patch
4 changes: 4 additions & 0 deletions .github/jenkinsfile/controller.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
monorepoControllerPipeline {
operatingSystem = ['ubuntu']
instanceSize = 'small'
}
1 change: 1 addition & 0 deletions .github/jenkinsfile/nightlyBuild.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nightlyBuildPipeline {}
6 changes: 6 additions & 0 deletions .github/jenkinsfile/seedJob.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
monorepoSeedPipeline {
operatingSystem = ['ubuntu']
instanceSize = 'small'
organizationName = 'theSymbolSyndicate'
gitHubId = 'theSymbolSyndicate-Github-app'
}
48 changes: 48 additions & 0 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Code Scanning - Action

'on':
push:
branches: [dev, main]
pull_request:
branches: [dev]
schedule:
# yamllint disable-line rule:quoted-strings
- cron: '44 12 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: [javascript-typescript]

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: /language:${{matrix.language}}
47 changes: 47 additions & 0 deletions .github/workflows/combine-dependabot-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Combine PRs

'on':
schedule:
# yamllint disable-line rule:quoted-strings
- cron: '0 2 * * 1' # Monday at 02:00 AM
workflow_dispatch: # allows you to manually trigger the workflow
inputs:
logLevel:
description: Log level
required: true
default: warning
type: choice
options:
- info
- warning
- debug

# The minimum permissions required to run this Action
permissions:
contents: write
pull-requests: write
repository-projects: write
checks: read

jobs:
combine-prs:
runs-on: ubuntu-latest

steps:
- name: combine dependabot prs
id: combine-prs
uses: github/[email protected]
with:
pr_title: '[dependency]: Combine dependabot PRs'
ci_required: true
branch_prefix: dependabot
labels: dependencies
pr_body_header: '# Combined Dependabot PRs ➡️📦⬅️'

- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.combine-prs.outputs.pr_url }}
run: gh pr merge --auto --squash --subject "$PR_TITLE" "$PR_URL"
env:
PR_URL: ${{ steps.combine-prs.outputs.pr_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_TITLE: '[dependency]: Combine dependabot PRs'
1 change: 1 addition & 0 deletions .gitlintmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tools/avatar-platform
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "_symbol"]
path = _symbol
url = https://github.com/symbol/symbol
branch = dev
1 change: 1 addition & 0 deletions _symbol
Submodule _symbol added at d06778
10 changes: 10 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

#!/bin/bash

set -ex

git submodule update --init
git -C _symbol config core.sparseCheckout true
echo 'jenkins/*' >>.git/modules/_symbol/info/sparse-checkout
echo 'linters/*' >>.git/modules/_symbol/info/sparse-checkout
git submodule update --force --checkout _symbol
1 change: 1 addition & 0 deletions jenkins
1 change: 1 addition & 0 deletions linters
7 changes: 7 additions & 0 deletions tools/avatar-platform/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
.next/
build/
dist/
coverage/
setupTests.js
next.config.js
24 changes: 24 additions & 0 deletions tools/avatar-platform/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
extends:
- ../../_symbol/linters/javascript/default.eslintrc
- plugin:tailwindcss/recommended
- eslint-config-next
- plugin:import/react

rules:
import/extensions:
- error
- always
- json: always
js: never
jsx: never
yoda: off

settings:
import/resolver:
jsconfig:
config: jsconfig.json

env:
browser: true
node: true
es2021: true
40 changes: 40 additions & 0 deletions tools/avatar-platform/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# env files (can opt-in for commiting if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
11 changes: 11 additions & 0 deletions tools/avatar-platform/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"exclude": [
"node_modules",
"coverage",
"dist",
"build",
"public",
"__tests__",
"*.config.{js,mj,cj}"
]
}
5 changes: 5 additions & 0 deletions tools/avatar-platform/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.next/
node_modules/
build/
coverage/
setupTests.js
9 changes: 9 additions & 0 deletions tools/avatar-platform/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bracketSpacing: true
jsxBracketSameLine: false
singleQuote: true
trailingComma: none
tabWidth: 4
useTabs: true
arrowParens: avoid
semi: true
printWidth: 140
7 changes: 7 additions & 0 deletions tools/avatar-platform/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
.next/
build/
dist/
coverage/
setupTests.js
next.config.js
18 changes: 18 additions & 0 deletions tools/avatar-platform/.stylelintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
extends:
- stylelint-config-standard-scss
- stylelint-config-rational-order

plugins:
- stylelint-order

rules:
font-family-no-missing-generic-family-keyword: null
font-family-name-quotes: always-unless-keyword
color-function-notation: legacy
selector-class-pattern: '([a-z]+([A-Z][a-z0-9]+)*)'
selector-id-pattern: '([a-z]+([A-Z][a-z0-9]+)*)'
at-rule-no-unknown: null
scss/at-rule-no-unknown:
- true
- ignoreAtRules:
- tailwind
11 changes: 11 additions & 0 deletions tools/avatar-platform/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
defaultCiPipeline {
operatingSystem = ['ubuntu']
instanceSize = 'medium'

ciBuildDockerfile = 'javascript.Dockerfile'

packageId = 'avatar-platform'

codeCoverageTool = 'c8'
minimumCodeCoverage = 95
}
Loading