Skip to content

Commit

Permalink
use pnpm action
Browse files Browse the repository at this point in the history
  • Loading branch information
sfxcode committed Oct 10, 2021
1 parent 54bcdb4 commit 7282fb9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 75 deletions.
75 changes: 17 additions & 58 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Open Cypress test runner:
pnpm test:e2e
```

Jest test runner:
Component test runner:

```
pnpm test:unit
Expand Down
16 changes: 0 additions & 16 deletions jest.config.js

This file was deleted.

0 comments on commit 7282fb9

Please sign in to comment.