From 93dbb69a799e111f43d5d333ff4f68dfc45eb150 Mon Sep 17 00:00:00 2001 From: Anjorin Damilare Date: Tue, 5 Apr 2022 19:53:23 +0100 Subject: [PATCH 1/2] chore: improves CI and added lint job --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c127d01..20cf7a91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,22 +2,54 @@ name: ci on: push: jobs: - build: - runs-on: ubuntu-20.04 + test: + runs-on: ubuntu-latest + + timeout-minutes: 10 + strategy: matrix: - node-version: [17] + node-version: [14.x, 17.x] + os: [ubuntu-latest, windows-latest] + + fail-fast: false + steps: - - uses: actions/checkout@v2 - - uses: pnpm/action-setup@v2.0.1 + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2.2.1 with: version: 7.0.0-rc.2 + - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' + - name: install run: pnpm install + - name: test run: pnpm test:ci + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install pnpm + - uses: pnpm/action-setup@v2.2.1 + with: + version: 7.0.0-rc.2 + + - name: Set node + uses: actions/setup-node@v3 + with: + node-version: 17.x + cache: 'pnpm' + + - name: Install + run: pnpm i + + - name: Lint + run: pnpm run lint From a5ef1046fc1cd555900ca4e5c74eb4b929c59d05 Mon Sep 17 00:00:00 2001 From: Makuza Mugabo Verite Date: Wed, 6 Apr 2022 11:00:54 +0200 Subject: [PATCH 2/2] fix: update ci build --- .github/workflows/ci.yml | 39 +++++-------------- {tests => src/rules}/assertion-type.test.ts | 2 +- {tests => src/rules}/lower-case-title.test.ts | 2 +- .../rules}/no-conditional-in-tests.test.ts | 2 +- {tests => src/rules}/no-skipped-tests.test.ts | 2 +- 5 files changed, 14 insertions(+), 33 deletions(-) rename {tests => src/rules}/assertion-type.test.ts (90%) rename {tests => src/rules}/lower-case-title.test.ts (92%) rename {tests => src/rules}/no-conditional-in-tests.test.ts (92%) rename {tests => src/rules}/no-skipped-tests.test.ts (89%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20cf7a91..1434799f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,42 +14,23 @@ jobs: fail-fast: false - steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2.2.1 - with: - version: 7.0.0-rc.2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'pnpm' - - - name: install - run: pnpm install - - - name: test - run: pnpm test:ci - - lint: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - - name: Install pnpm - uses: pnpm/action-setup@v2.2.1 with: version: 7.0.0-rc.2 - - name: Set node + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: 17.x - cache: 'pnpm' + node-version: ${{ matrix.node-version }} + cache: "pnpm" + + - name: install + run: pnpm install - - name: Install - run: pnpm i + - name: lint + run: pnpm lint - - name: Lint - run: pnpm run lint + - name: test + run: pnpm test:ci diff --git a/tests/assertion-type.test.ts b/src/rules/assertion-type.test.ts similarity index 90% rename from tests/assertion-type.test.ts rename to src/rules/assertion-type.test.ts index 8b4e52cb..439c4bc8 100644 --- a/tests/assertion-type.test.ts +++ b/src/rules/assertion-type.test.ts @@ -1,6 +1,6 @@ import { RuleTester } from "@typescript-eslint/utils/dist/ts-eslint" import { it } from "vitest" -import { RULE_NAME } from "../src/rules/assertion-type" +import { RULE_NAME } from "./assertion-type" const valid = [`it.each()`] diff --git a/tests/lower-case-title.test.ts b/src/rules/lower-case-title.test.ts similarity index 92% rename from tests/lower-case-title.test.ts rename to src/rules/lower-case-title.test.ts index 6aa97051..938d3025 100644 --- a/tests/lower-case-title.test.ts +++ b/src/rules/lower-case-title.test.ts @@ -1,6 +1,6 @@ import { RuleTester } from "@typescript-eslint/utils/dist/ts-eslint" import { it } from "vitest" -import rule, { RULE_NAME } from "../src/rules/lower-case-title" +import rule, { RULE_NAME } from "./lower-case-title" diff --git a/tests/no-conditional-in-tests.test.ts b/src/rules/no-conditional-in-tests.test.ts similarity index 92% rename from tests/no-conditional-in-tests.test.ts rename to src/rules/no-conditional-in-tests.test.ts index 9545f2dc..19609175 100644 --- a/tests/no-conditional-in-tests.test.ts +++ b/src/rules/no-conditional-in-tests.test.ts @@ -1,6 +1,6 @@ import { RuleTester } from "@typescript-eslint/utils/dist/ts-eslint" import { it } from "vitest" -import rule, { RULE_NAME } from "../src/rules/no-conditional-in-tests" +import rule, { RULE_NAME } from "./no-conditional-in-tests" const invalids = [ `describe('my tests', () => { diff --git a/tests/no-skipped-tests.test.ts b/src/rules/no-skipped-tests.test.ts similarity index 89% rename from tests/no-skipped-tests.test.ts rename to src/rules/no-skipped-tests.test.ts index 552dad88..4d0d5ea2 100644 --- a/tests/no-skipped-tests.test.ts +++ b/src/rules/no-skipped-tests.test.ts @@ -1,6 +1,6 @@ import { RuleTester } from "@typescript-eslint/utils/dist/ts-eslint" import { it } from "vitest" -import rule, { RULE_NAME } from "../src/rules/no-skipped-tests" +import rule, { RULE_NAME } from "./no-skipped-tests" const valids = [ `it("test", () => {});`,