diff --git a/.eslintignore b/.eslintignore index 763301f..64f046d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ dist/ -node_modules/ \ No newline at end of file +node_modules/ +coverage/ \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index ed2cee4..d768f01 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,6 +12,8 @@ "plugins": ["unused-imports"], "rules": { "@typescript-eslint/strict-boolean-expressions": "off", + "@typescript-eslint/no-unsafe-argument": "warn", + "@typescript-eslint/return-await": "off", "@typescript-eslint/no-unused-vars": "off", "unused-imports/no-unused-imports": "error", "unused-imports/no-unused-vars": [ diff --git a/.github/workflows/ci-workflow.yaml b/.github/workflows/ci-workflow.yaml new file mode 100644 index 0000000..82027b7 --- /dev/null +++ b/.github/workflows/ci-workflow.yaml @@ -0,0 +1,50 @@ +name: CI Pipeline + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + lint-and-test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x, 18.x, 20.x] + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8.15.4 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + # - uses: actions/cache@v3 + # name: Setup pnpm cache + # with: + # path: ${{ env.STORE_PATH }} + # key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + # restore-keys: | + # ${{ runner.os }}-pnpm-store- + + - name: Install + run: pnpm install --frozen-lockfile --strict-peer-dependencies + - run: pnpm build + - run: pnpm lint + - run: pnpm prettier + - run: pnpm test:cov + + - name: Update Coverage Badge + if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) + uses: we-cli/coverage-badge-action@main diff --git a/.gitignore b/.gitignore index fc4006e..fd7850a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ logs # Misc .DS_Store .npmrc +coverage/ \ No newline at end of file diff --git a/Readme.md b/Readme.md index f3cd92f..d0b47ac 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,9 @@ + + +[](https://github.com/mahendraHegde/node-idempotency/actions) + +--- +