diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml new file mode 100644 index 0000000..2470783 --- /dev/null +++ b/.github/workflows/code_quality.yml @@ -0,0 +1,40 @@ +name: Code quality + +on: + pull_request: + branches: ["*"] + +jobs: + tests-and-linters: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.10.0 + run_install: false + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + + - name: Install dependencies + run: pnpm --version && pnpm install --frozen-lockfile + + - name: Check prettier + run: pnpm lint:prettier + + - name: Check eslint + run: pnpm lint:eslint + + - name: Check types + run: pnpm lint:tsc + + - name: Check coverage + run: | + COVERAGE="$(pnpm --silent test:coverage:avg)" + echo "Average coverage: ${RESULT}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bdcbc85..aa84570 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Linters and tests +name: Tests on: pull_request: @@ -25,14 +25,5 @@ jobs: - name: Install dependencies run: pnpm --version && pnpm install --frozen-lockfile - - name: Check prettier - run: pnpm lint:prettier - - - name: Check eslint - run: pnpm lint:eslint - - - name: Check types - run: pnpm lint:tsc - - name: Run tests run: pnpm test diff --git a/src/lib/graphql/helpers.test.ts b/src/lib/graphql/helpers.test.ts index b1a1285..e10deff 100644 --- a/src/lib/graphql/helpers.test.ts +++ b/src/lib/graphql/helpers.test.ts @@ -76,7 +76,7 @@ describe("helpers", () => { expect(getOperationName(document)).toBe(""); }); - test.only("should return the correct operation names when there are multiple operations", () => { + test("should return the correct operation names when there are multiple operations", () => { const document = ` query GetUser { user(id: "1") {