diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4595975 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +# .github/workflows/ci.yml + +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-and-test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] # Use the version of Node.js that matches your project's requirements + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 16 + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Compile TypeScript + run: yarn tsc --noEmit + + - name: Run tests + run: yarn test diff --git a/tests/holderDiffs.test.ts b/tests/holderDiffs.test.ts index 29fc0cd..2400a62 100644 --- a/tests/holderDiffs.test.ts +++ b/tests/holderDiffs.test.ts @@ -52,6 +52,7 @@ describe('Errors in the differences between two trees', async function () { merkleRootsProvider: new ManualMerkleRootsProvider(), }; + const report = await checkHolderValidity(testContext, testReport); expect(report.err).to.equal(false); diff --git a/tests/overclaims.test.ts b/tests/overclaims.test.ts index 380b43b..cb21270 100644 --- a/tests/overclaims.test.ts +++ b/tests/overclaims.test.ts @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { describe, it } from 'node:test'; import { DisputeContext } from '../src/bot/context'; -import { checkHolderValidity, checkOverclaimedRewards } from '../src/bot/runner'; +import { checkOverclaimedRewards } from '../src/bot/runner'; import ConsoleLogger from '../src/helpers/logger/ConsoleLogger'; import { BotError, MerklReport, Resolver, StepResult } from '../src/types/bot'; import ManualChainProvider from './helpers/ManualChainProvider'; @@ -31,7 +31,7 @@ describe('Overclaim detections', async function () { const holdersReport = await checkHolderValidity(testContext, testReport); const report = await checkOverclaimedRewards(testContext, holdersReport.res.report); - + expect(report.err).to.equal(true); report.err && expect(report.res.code).to.equal(BotError.AlreadyClaimed); });