diff --git a/.github/workflows/prerequisites.yml b/.github/workflows/prerequisites.yml new file mode 100644 index 0000000..ba905ee --- /dev/null +++ b/.github/workflows/prerequisites.yml @@ -0,0 +1,30 @@ +name: Prerequisites + +on: + pull_request: + types: [synchronize, opened, edited, ready_for_review, reopened, unlocked] + branches: [main, development] + +permissions: + checks: write + contents: write + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Run tests and generate coverage + uses: ArtiomTr/jest-coverage-report-action@v2.3.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + threshold: 90 \ No newline at end of file diff --git a/jest.config.ts b/jest.config.ts index 5d2aa7b..d7715cc 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -25,7 +25,7 @@ const config: Config = { // collectCoverageFrom: undefined, // The directory where Jest should output its coverage files - coverageDirectory: 'tests/coverage', + coverageDirectory: 'tests/unit/coverage', // An array of regexp pattern strings used to skip coverage collection // coveragePathIgnorePatterns: [ @@ -40,6 +40,7 @@ const config: Config = { 'json', 'text', 'lcov', + 'text-summary', 'clover' ],