|
| 1 | +name: Code check |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: ["*"] |
| 6 | + |
| 7 | +jobs: |
| 8 | + lint: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + name: Lint |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v3 |
| 13 | + with: |
| 14 | + fetch-depth: 0 |
| 15 | + |
| 16 | + - name: Install Node.js |
| 17 | + uses: actions/setup-node@v3 |
| 18 | + with: |
| 19 | + node-version: 16 |
| 20 | + |
| 21 | + |
| 22 | + name: Install pnpm |
| 23 | + id: pnpm-install |
| 24 | + with: |
| 25 | + run_install: false |
| 26 | + |
| 27 | + - name: Get pnpm store directory |
| 28 | + id: pnpm-cache |
| 29 | + run: | |
| 30 | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT |
| 31 | + - uses: actions/cache@v3 |
| 32 | + name: Setup pnpm cache |
| 33 | + with: |
| 34 | + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
| 35 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 36 | + restore-keys: | |
| 37 | + ${{ runner.os }}-pnpm-store- |
| 38 | + - name: Install dependencies |
| 39 | + run: pnpm install |
| 40 | + |
| 41 | + - run: pnpm lint |
| 42 | + |
| 43 | + format: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + name: Format |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v3 |
| 48 | + with: |
| 49 | + fetch-depth: 0 |
| 50 | + |
| 51 | + - name: Install Node.js |
| 52 | + uses: actions/setup-node@v3 |
| 53 | + with: |
| 54 | + node-version: 16 |
| 55 | + |
| 56 | + |
| 57 | + name: Install pnpm |
| 58 | + id: pnpm-install |
| 59 | + with: |
| 60 | + run_install: false |
| 61 | + |
| 62 | + - name: Get pnpm store directory |
| 63 | + id: pnpm-cache |
| 64 | + run: | |
| 65 | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT |
| 66 | +
|
| 67 | + - uses: actions/cache@v3 |
| 68 | + name: Setup pnpm cache |
| 69 | + with: |
| 70 | + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
| 71 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 72 | + restore-keys: | |
| 73 | + ${{ runner.os }}-pnpm-store- |
| 74 | +
|
| 75 | + - name: Install dependencies |
| 76 | + run: pnpm install |
| 77 | + |
| 78 | + - run: pnpm format:check |
| 79 | + |
| 80 | + tsc: |
| 81 | + runs-on: ubuntu-latest |
| 82 | + name: TypeScript |
| 83 | + steps: |
| 84 | + - uses: actions/checkout@v3 |
| 85 | + with: |
| 86 | + fetch-depth: 0 |
| 87 | + |
| 88 | + - name: Install Node.js |
| 89 | + uses: actions/setup-node@v3 |
| 90 | + with: |
| 91 | + node-version: 16 |
| 92 | + |
| 93 | + |
| 94 | + name: Install pnpm |
| 95 | + id: pnpm-install |
| 96 | + with: |
| 97 | + run_install: false |
| 98 | + |
| 99 | + - name: Get pnpm store directory |
| 100 | + id: pnpm-cache |
| 101 | + run: | |
| 102 | + echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT |
| 103 | + - uses: actions/cache@v3 |
| 104 | + name: Setup pnpm cache |
| 105 | + with: |
| 106 | + path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} |
| 107 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 108 | + restore-keys: | |
| 109 | + ${{ runner.os }}-pnpm-store- |
| 110 | + - name: Install dependencies |
| 111 | + run: pnpm install |
| 112 | + |
| 113 | + - run: pnpm typecheck |
0 commit comments