Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanregisser authored Apr 12, 2024
0 parents commit 5c6e784
Show file tree
Hide file tree
Showing 22 changed files with 5,698 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: ['@valora/eslint-config-typescript'],
parserOptions: {
project: './tsconfig.test.json',
},
rules: {
// Maybe move it to @valora/eslint-config-typescript?
'jest/valid-title': ['error', { ignoreTypeOfDescribeName: true }],
},
ignorePatterns: ['tsconfig.json'],
}
18 changes: 18 additions & 0 deletions .github/workflows/semantic-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Semantic PR title

on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

jobs:
semantic-pr-title:
name: Semantic PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106 changes: 106 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Workflow

on:
# Run on pushes to main..
push:
branches:
- main
# ..and any pull request.
pull_request:

# Cancel any in progress run of the workflow for a given PR
# This avoids building outdated code
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
check-for-sh:
name: Check for .sh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: "echo '*** Do not write .sh scripts! ***'; ! find . -type f -name '*.sh' | grep ."
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
check-latest: true
- run: yarn
- run: yarn typecheck
- run: yarn format:check
- run: yarn lint
knip:
name: Knip
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
check-latest: true
- run: yarn
- run: yarn knip
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
check-latest: true
- run: yarn
- run: yarn test:ci
# - name: Upload Coverage Report
# uses: actions/upload-artifact@v3
# with:
# path: coverage/lcov-report
# - name: 'Upload coverage to Codecov'
# uses: codecov/codecov-action@v3
deploy:
name: Deploy
if: github.ref == 'refs/heads/main'
needs:
- lint
- knip
- test
runs-on: ubuntu-latest
steps:
# Repo needs to be given access to the MAINNET_SERVICE_ACCOUNT_KEY secret to access the slack webhook
# https://github.com/organizations/valora-inc/settings/secrets/actions/MAINNET_SERVICE_ACCOUNT_KEY
- uses: google-github-actions/auth@v2
with:
project_id: celo-mobile-mainnet
credentials_json: ${{ secrets.MAINNET_SERVICE_ACCOUNT_KEY }}
- name: Fetch Secrets
id: slack-webhook
uses: google-github-actions/get-secretmanager-secrets@v2.1.0
with:
# This can point to any slack webhook URL stored in GC Secret Manager
secrets: |-
SLACK_WEBHOOK_URL:projects/1027349420744/secrets/SLACK_ONCALL_WEBHOOK_URL
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
check-latest: true
- run: yarn
- run: yarn deploy
- uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
notification_title: '{workflow} has {status_message}'
message_format: '{emoji} *{workflow}* {status_message}. <{run_url}|View Run>'
footer: 'Repo: <{repo_url}|{repo}>'
notify_when: 'failure'
# Tag @supporthero on failures, can change to any slack group id
mention_groups: 'S0277QUM4KB'
mention_groups_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ steps.slack-webhook.outputs.SLACK_WEBHOOK_URL }}
110 changes: 110 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# IDE
.idea

# Ignore generated credentials from google-github-actions/auth
gha-creds-*.json
5 changes: 5 additions & 0 deletions .knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"entry": ["src/index.ts"],
"project": ["src/**/*/.ts"],
"ignoreDependencies": ["@types/jest", "@valora/prettier-config"]
}
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore since running yarn add package will rewrite it
package.json

# Ignore generated dist folder
dist
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
// Use the project's TypeScript version instead of the one bundled with VS Code
"typescript.tsdk": "node_modules/typescript/lib"
}
Loading

0 comments on commit 5c6e784

Please sign in to comment.