Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
railway-bot committed Nov 27, 2023
0 parents commit 5f7793e
Show file tree
Hide file tree
Showing 239 changed files with 48,135 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
dist
node_modules
.github
.test-reports
.coverage
seeds
test
!test/integration
.eslint*
.nvmrc
.nyc_output
docker-compose.yml
Dockerfile
*.env
*.md
.nostr
postgresql.conf
test/integration/docker-compose.yml
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
.test-reports
.coverage
.nostr
35 changes: 35 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
root: true,
env: {
node: true,
},
ignorePatterns: ['dist', 'tslint.json', 'node_modules'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
semi: ['error', 'never'],
quotes: ['error', 'single', { avoidEscape: true }],
'sort-imports': ['error', {
ignoreCase: true,
allowSeparatedGroups: true,
}],
curly: [2, 'multi-line'],
'max-len': [
'error',
{
code: 120,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'comma-dangle': ['error', 'always-multiline'],
},
}
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] "
labels: bug
assignees: Cameri

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Run command '...'
2. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**System (please complete the following information):**
- OS: [e.g. Ubuntu]
- Platform: [e.g. docker, standalone]
- Version: [e.g. 1.9.11]

**Logs**
If applicable, attach log messages showing the bug and context when the bug happened.

**Additional context**
Add any other context about the problem here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[REQUEST]"
labels: enhancement
assignees: Cameri

---

**Pledge**
If the feature or idea is implemented or resolved to your satisfaction, please consider making a small monetary donation to support the continued development and independence of this project. To help the maintainers gauge on where to focus their effort, please include the amount of your pledge. A wallet address or Lightning invoice will be provided once the feature is complete.

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
36 changes: 36 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->

## Related Issue
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Non-functional change (docs, style, minor refactor)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING** document.
- [ ] I have added tests to cover my code changes.
- [ ] All new and existing tests passed.
179 changes: 179 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
name: CI Checks

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
commit-lint:
name: Lint commits
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run commitlint
uses: wagoid/commitlint-github-action@v5
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
build-check:
name: Build check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run ESLint
run: npm run build:check
test-units-and-cover:
name: Unit Tests And Coverage
runs-on: ubuntu-latest
needs:
- commit-lint
- lint
- build-check
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run unit tests
run: npm run test:unit
- name: Run coverage for unit tests
run: npm run cover:unit
if: ${{ always() }}
- uses: actions/upload-artifact@v3
name: Upload coverage report for unit tests
if: ${{ always() }}
with:
path: .coverage/*/lcov.info
- name: Coveralls
uses: coverallsapp/github-action@master
if: ${{ always() }}
with:
path-to-lcov: ./.coverage/unit/lcov.info
flag-name: Unit
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
test-integrations-and-cover:
name: Integration Tests and Coverage
runs-on: ubuntu-latest
needs:
- commit-lint
- lint
- build-check
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Run integration tests
run: npm run docker:test:integration
- name: Generate Cucumber report annotations
uses: deblockt/[email protected]
if: ${{ always() }}
continue-on-error: true
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
path: .test-reports/integration/report.json
- name: Run coverage for integration tests
run: npm run docker:cover:integration
- name: Coveralls
uses: coverallsapp/github-action@master
if: ${{ always() }}
with:
path-to-lcov: .coverage/integration/lcov.info
flag-name: Integration
parallel: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
name: Upload coverage report for integration tests
if: ${{ always() }}
with:
path: .coverage/*/lcov.info
sonarcloud:
name: Sonarcloud
needs: [test-units-and-cover, test-integrations-and-cover]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
name: Download unit & integration coverage reports
with:
path: .coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
post-tests:
name: Post Tests
needs: [test-units-and-cover, test-integrations-and-cover]
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
release:
name: Release
runs-on: ubuntu-latest
needs: [test-units-and-cover, test-integrations-and-cover]
if: github.ref == 'refs/heads/main'
environment: release
env:
TELEGRAM_BOT_ID: ${{ secrets.TELEGRAM_BOT_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Install package dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
release:
types: [published]
workflow_dispatch:

jobs:
build-and-push-image:
name: Build and push container image
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Loading

0 comments on commit 5f7793e

Please sign in to comment.