diff --git a/.circleci/config.yml b/.circleci/config.yml index bde6e703..b7f13ac8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -146,27 +146,7 @@ jobs: - run: name: Stop React App command: pkill -f npm - jest-tests: - docker: - - image: cimg/node:20.13 - resource_class: medium - steps: - - checkout - - restore_cache: - key: app-{{ checksum "app/package-lock.json" }} - - run: - name: Install Dependencies - command: cd app && npm install --legacy-peer-deps - - save_cache: - key: app-{{ checksum "app/package-lock.json" }} - paths: - - ./app/node_modules - - run: - name: Run Jest Tests - command: cd app && CI=true npm test -- --watchAll=false --coverage --coverageReporters=text --coverageReporters=lcov - - store_artifacts: - path: app/coverage - destination: coverage-report + # Jest tests moved to GitHub Actions (.github/workflows/jest-tests.yml) cypress-e2e-tests: docker: - image: cimg/node:20.18-browsers @@ -217,5 +197,5 @@ workflows: wrolpi-app-test: jobs: - react-app-start - - jest-tests + # jest-tests moved to GitHub Actions - cypress-e2e-tests diff --git a/.github/workflows/jest-tests.yml b/.github/workflows/jest-tests.yml new file mode 100644 index 00000000..b189c466 --- /dev/null +++ b/.github/workflows/jest-tests.yml @@ -0,0 +1,39 @@ +name: Jest Tests + +on: + push: + branches: [master, feature/*] + pull_request: + branches: [master] + +jobs: + jest-tests: + runs-on: ubuntu-latest + + defaults: + run: + working-directory: app + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: app/package-lock.json + + - name: Install dependencies + run: npm install --legacy-peer-deps + + - name: Run Jest tests + run: CI=true npm test -- --watchAll=false --coverage --coverageReporters=text --coverageReporters=lcov + + - name: Upload coverage report + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: app/coverage + retention-days: 30