diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25a3131..fcefcf0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,72 +1,31 @@ -name: CI + +name: 'ci' on: push: - branches: [main] + branches: + - main pull_request: - branches: [main] - + branches: + - main jobs: - ci: - # The type of runner that the job will run on + test: runs-on: ubuntu-latest - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - ## Yarn dir - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - ## Cache - - name: Cache yarn cache - uses: actions/cache@v2 - id: cache-yarn-cache2 + - name: Install pnpm + uses: pnpm/action-setup@v2.0.1 with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn2-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn2- + version: 6.16.1 - ## Cache - - name: Cache node_modules - id: cache-node-modules2 - uses: actions/cache@v2 + - name: Set node version to 16 + uses: actions/setup-node@v2 with: - path: node_modules - key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules2-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.node-version }}-nodemodules2- + node-version: 16 + cache: 'pnpm' - ## Cache - - name: Cache Cypress - id: cache-cypress2 - uses: actions/cache@v2 - with: - path: /home/runner/.cache/Cypress - key: ${{ runner.os }}-${{ matrix.node-version }}-cypress2-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.node-version }}-cypress2- + - run: pnpm install - ## Dependencies - - name: Install Dependencies - if: | - steps.cache-yarn-cache.outputs.cache-hit != 'true' || - steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn - - ## Test - - name: Start Vite devserver - run: yarn start - - - name: Run tests - run: yarn test:ci - - - name: Upload artifacts on fail - uses: actions/upload-artifact@v2 - if: failure() - with: - name: videos - path: cypress/videos/ + - name: Run unit tests + run: pnpm run test:unit diff --git a/README.md b/README.md index 3a67a40..09dc093 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Open Cypress test runner: pnpm test:e2e ``` -Jest test runner: +Component test runner: ``` pnpm test:unit diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index 77054a8..0000000 --- a/jest.config.js +++ /dev/null @@ -1,16 +0,0 @@ -// jest.config.js -module.exports = { - moduleFileExtensions: [ - 'js', - 'ts', - 'json', - 'vue' - ], - transform: { - '^.+\\.ts$': 'ts-jest', - '^.+\\.vue$': 'vue-jest' - }, - roots: [ - "./tests/unit" - ] -}