Skip to content

Commit

Permalink
deploy niskala
Browse files Browse the repository at this point in the history
  • Loading branch information
washboardalex committed Feb 23, 2025
0 parents commit 68b0bab
Show file tree
Hide file tree
Showing 41 changed files with 11,946 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
require('@uniswap/eslint-config/load')

module.exports = {
extends: ['@uniswap/eslint-config/node'],
rules: {
'@typescript-eslint/no-inferrable-types': 'off',
'import/no-unused-modules': 'off',
'@typescript-eslint/no-restricted-imports': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
],
'@typescript-eslint/no-this-alias': [
'error',
{
allowDestructuring: true, // Allow `const { props, state } = this`; false by default
allowedNames: [
'self', // Allow `const self= this`; `[]` by default
],
},
],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': [
'error',
{
types: {
// Allow BigInt (uppercase)
BigInt: false,
},
},
],
},
overrides: [
{
files: ['tests/**/*.ts'],
settings: {
jest: {
version: 26,
},
// jest is added as a plugin in our org's eslint config, but we use
// matchstick, and this would crash when linting matchstick files.
'disable/plugins': ['jest'],
},
},
],
}
93 changes: 93 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI

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

jobs:
lint:
name: lint
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref || '' }}
token: ${{ secrets.github_token }}

- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: https://registry.npmjs.org

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- name: Install dependencies
run: yarn install

- name: Lint
run: yarn run lint

- name: Commit lint fixes
if: github.event_name == 'pull_request'
run: |
git config --global user.name "${{ github.event.pull_request.user.login }}"
git config --global user.email "${{ github.event.pull_request.user.login }}@users.noreply.github.com"
if [ -z "$(git diff)" ]; then exit; fi
git commit -a -m "fix(lint): auto-fix [ci]"
git push
build-and-test:
needs: lint
name: build-and-test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18.x'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- name: Install dependencies
run: yarn install

- name: Build project
run: yarn build

- name: Build Docker
run: yarn build:docker

- name: Test
# We need to run test in this mode because github CI is non-interactive
run: yarn test:no-tty
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build/
node_modules/
src/types/
.DS_STORE
yarn-error.log
tests/.bin/
tests/.docker/
tests/.latest.json
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 120,
"trailingComma": "all"
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.formatting.provider": "black"
}
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# copied from https://github.com/LimeChain/demo-subgraph/blob/main/Dockerfile

FROM --platform=linux/x86_64 ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive

ENV ARGS=""

RUN apt update \
&& apt install -y sudo curl postgresql postgresql-contrib

RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - \
&& sudo apt-get install -y nodejs

RUN curl -OL https://github.com/LimeChain/matchstick/releases/download/0.6.0/binary-linux-22 \
&& chmod a+x binary-linux-22

RUN mkdir matchstick
WORKDIR /matchstick

CMD ../binary-linux-22 ${ARGS}
Loading

0 comments on commit 68b0bab

Please sign in to comment.