From 038ce61339429e33b3997227fb3d16181af71ff7 Mon Sep 17 00:00:00 2001 From: Don Mosites Date: Wed, 20 Sep 2023 14:01:02 +0200 Subject: [PATCH 1/5] fix build and add test action --- .env | 2 -- .env.example | 2 ++ .eslintrc.cjs | 2 +- .github/workflows/integration.yml | 31 +++++++++++++++++++ .gitignore | 1 + .vscode/extensions.json | 13 -------- .../common/hooks/useMultipleTokenInfo.ts | 2 +- 7 files changed, 36 insertions(+), 17 deletions(-) delete mode 100644 .env create mode 100644 .env.example create mode 100644 .github/workflows/integration.yml delete mode 100644 .vscode/extensions.json diff --git a/.env b/.env deleted file mode 100644 index ba92387..0000000 --- a/.env +++ /dev/null @@ -1,2 +0,0 @@ -VITE_INFURA_API_KEY= -VITE_WALLETCONNECT_ID= diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..cc2cd2a --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +VITE_INFURA_API_KEY= +VITE_WALLETCONNECT_ID= \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 2dc02db..ec20ce0 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -6,7 +6,7 @@ module.exports = { "plugin:@typescript-eslint/recommended", "plugin:react-hooks/recommended", ], - ignorePatterns: ["dist", ".eslintrc.cjs"], + ignorePatterns: ["dist", ".eslintrc.cjs", "index.js"], parser: "@typescript-eslint/parser", plugins: ["react-refresh"], rules: { diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..aa2f2ca --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,31 @@ +name: Tests +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Test using Node.js + uses: actions/setup-node@v3 + with: + node-version: 16.15.1 + - run: yarn + - run: yarn build + - name: Tests ✅ + if: ${{ success() }} + run: | + curl --request POST --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' --header 'content-type: application/json' --data '{ + "context": "tests", + "state": "success", + "description": "Tests passed", + "target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + }' + - name: Tests 🚨 + if: ${{ failure() }} + run: | + curl --request POST --url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' --header 'content-type: application/json' --data '{ + "context": "tests", + "state": "failure", + "description": "Tests failed", + "target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + }' diff --git a/.gitignore b/.gitignore index a547bf3..a0377b4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ lerna-debug.log* node_modules dist dist-ssr +.env *.local # Editor directories and files diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index ca62475..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. - // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp - - // List of extensions which should be recommended for users of this workspace. - "recommendations": [ - "esbenp.prettier-vscode", - "bradlc.vscode-tailwindcss", - "vsls-contrib.codetour" - ], - // List of extensions recommended by VS Code that should not be recommended for users of this workspace. - "unwantedRecommendations": [] -} diff --git a/src/features/common/hooks/useMultipleTokenInfo.ts b/src/features/common/hooks/useMultipleTokenInfo.ts index 0ee4aa9..b887900 100644 --- a/src/features/common/hooks/useMultipleTokenInfo.ts +++ b/src/features/common/hooks/useMultipleTokenInfo.ts @@ -5,7 +5,7 @@ import { multicall } from "wagmi/actions"; type TokenInfoQueryKey = [ chainId: number, tokenAddress: `0x${string}`, - "tokenInfo", + tokenInfo: "tokenInfo", ]; const fetchTokenInfo = async ({ From 595a3dca1345831d0810c6a4067995951787f3c1 Mon Sep 17 00:00:00 2001 From: Don Mosites Date: Wed, 20 Sep 2023 14:01:34 +0200 Subject: [PATCH 2/5] rename integration to test --- .github/workflows/{integration.yml => test.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{integration.yml => test.yml} (100%) diff --git a/.github/workflows/integration.yml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/integration.yml rename to .github/workflows/test.yml From d8705c702fda2dd96550be50a4d3f215d5d8ec00 Mon Sep 17 00:00:00 2001 From: Don Mosites Date: Wed, 20 Sep 2023 14:05:35 +0200 Subject: [PATCH 3/5] restore .vscode/extensions.json --- .vscode/extensions.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..e69de29 From 49fb07f852ba2a72319f892e3a4cd5729d11878b Mon Sep 17 00:00:00 2001 From: Don Mosites Date: Wed, 20 Sep 2023 14:06:09 +0200 Subject: [PATCH 4/5] restore .vscode/extensions.json content --- .vscode/extensions.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index e69de29..a2f4523 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -0,0 +1,13 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "esbenp.prettier-vscode", + "bradlc.vscode-tailwindcss", + "vsls-contrib.codetour" + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [] +} \ No newline at end of file From 5012a7fd06596db75454f764ef81baaa5c82355a Mon Sep 17 00:00:00 2001 From: Don Mosites Date: Wed, 20 Sep 2023 14:12:41 +0200 Subject: [PATCH 5/5] run check on pull request synchronize --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aa2f2ca..5766683 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,7 @@ name: Tests -on: [push, pull_request] +on: + pull_request: + types: [synchronize] jobs: test: runs-on: ubuntu-latest