|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +env: |
| 12 | + YARN_CACHE_FOLDER: ~/.yarn |
| 13 | + |
| 14 | +jobs: |
| 15 | + unit-tests: |
| 16 | + name: Unit tests |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v2 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + |
| 24 | + - name: Setup Node.js |
| 25 | + uses: actions/setup-node@v1 |
| 26 | + with: |
| 27 | + node-version: 14 |
| 28 | + |
| 29 | + - name: Caching |
| 30 | + uses: actions/cache@v2 |
| 31 | + with: |
| 32 | + path: ${{ env.YARN_CACHE_FOLDER }} |
| 33 | + key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 34 | + restore-keys: | |
| 35 | + ${{ runner.OS }}-yarn-${{ env.cache-name }} |
| 36 | + ${{ runner.OS }}-yarn- |
| 37 | +
|
| 38 | + - name: Installing dependencies |
| 39 | + run: yarn install --frozen-lockfile |
| 40 | + |
| 41 | + - name: Unit test |
| 42 | + run: yarn test |
| 43 | + |
| 44 | + - uses: artiomtr/jest-coverage-report-action@v2.0-rc.1 |
| 45 | + if: "github.event_name == 'pull_request'" |
| 46 | + with: |
| 47 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + skip-step: all |
| 49 | + |
| 50 | + typecheck: |
| 51 | + name: Typecheck |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - name: Checkout |
| 55 | + uses: actions/checkout@v2 |
| 56 | + with: |
| 57 | + fetch-depth: 0 |
| 58 | + |
| 59 | + - name: Setup Node.js |
| 60 | + uses: actions/setup-node@v1 |
| 61 | + with: |
| 62 | + node-version: 14 |
| 63 | + |
| 64 | + - name: Caching |
| 65 | + uses: actions/cache@v2 |
| 66 | + with: |
| 67 | + path: ${{ env.YARN_CACHE_FOLDER }} |
| 68 | + key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 69 | + restore-keys: | |
| 70 | + ${{ runner.OS }}-yarn-${{ env.cache-name }} |
| 71 | + ${{ runner.OS }}-yarn- |
| 72 | +
|
| 73 | + - name: Installing dependencies |
| 74 | + run: yarn install --frozen-lockfile |
| 75 | + |
| 76 | + - name: Typecheck |
| 77 | + run: yarn typecheck |
| 78 | + |
| 79 | + lint: |
| 80 | + name: Lint |
| 81 | + runs-on: ubuntu-latest |
| 82 | + steps: |
| 83 | + - name: Checkout |
| 84 | + uses: actions/checkout@v2 |
| 85 | + with: |
| 86 | + fetch-depth: 0 |
| 87 | + |
| 88 | + - name: Setup Node.js |
| 89 | + uses: actions/setup-node@v1 |
| 90 | + with: |
| 91 | + node-version: 14 |
| 92 | + |
| 93 | + - name: Caching |
| 94 | + uses: actions/cache@v2 |
| 95 | + with: |
| 96 | + path: ${{ env.YARN_CACHE_FOLDER }} |
| 97 | + key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 98 | + restore-keys: | |
| 99 | + ${{ runner.OS }}-yarn-${{ env.cache-name }} |
| 100 | + ${{ runner.OS }}-yarn- |
| 101 | +
|
| 102 | + - name: Installing dependencies |
| 103 | + run: yarn install --frozen-lockfile |
| 104 | + |
| 105 | + - name: Lint |
| 106 | + run: yarn lint |
| 107 | + |
| 108 | + check-format: |
| 109 | + name: Check format |
| 110 | + runs-on: ubuntu-latest |
| 111 | + steps: |
| 112 | + - name: Checkout |
| 113 | + uses: actions/checkout@v2 |
| 114 | + with: |
| 115 | + fetch-depth: 0 |
| 116 | + |
| 117 | + - name: Setup Node.js |
| 118 | + uses: actions/setup-node@v1 |
| 119 | + with: |
| 120 | + node-version: 14 |
| 121 | + |
| 122 | + - name: Caching |
| 123 | + uses: actions/cache@v2 |
| 124 | + with: |
| 125 | + path: ${{ env.YARN_CACHE_FOLDER }} |
| 126 | + key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 127 | + restore-keys: | |
| 128 | + ${{ runner.OS }}-yarn-${{ env.cache-name }} |
| 129 | + ${{ runner.OS }}-yarn- |
| 130 | +
|
| 131 | + - name: Installing dependencies |
| 132 | + run: yarn install --frozen-lockfile |
| 133 | + |
| 134 | + - name: Check format |
| 135 | + run: yarn lint:format |
0 commit comments