forked from Labrys-Group/glue-uniswap-v3-subgraph
-
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.
- Loading branch information
0 parents
commit 68b0bab
Showing
41 changed files
with
11,946 additions
and
0 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 |
---|---|---|
@@ -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'], | ||
}, | ||
}, | ||
], | ||
} |
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,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 |
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,8 @@ | ||
build/ | ||
node_modules/ | ||
src/types/ | ||
.DS_STORE | ||
yarn-error.log | ||
tests/.bin/ | ||
tests/.docker/ | ||
tests/.latest.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"trailingComma": "all" | ||
} |
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,3 @@ | ||
{ | ||
"python.formatting.provider": "black" | ||
} |
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,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} |
Oops, something went wrong.