|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - market |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + - market |
| 12 | + |
| 13 | +jobs: |
| 14 | + install: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Set up Node.js |
| 22 | + uses: actions/setup-node@v4 |
| 23 | + with: |
| 24 | + node-version: 20 |
| 25 | + |
| 26 | + - name: Cache node_modules |
| 27 | + uses: actions/cache@v4 |
| 28 | + with: |
| 29 | + path: '**/node_modules' |
| 30 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 31 | + restore-keys: | |
| 32 | + ${{ runner.os }}-node- |
| 33 | +
|
| 34 | + - name: Install dependencies |
| 35 | + run: npm ci |
| 36 | + |
| 37 | + lint: |
| 38 | + runs-on: ubuntu-latest |
| 39 | + needs: |
| 40 | + - install |
| 41 | + |
| 42 | + steps: |
| 43 | + - name: Checkout code |
| 44 | + uses: actions/checkout@v4 |
| 45 | + |
| 46 | + - name: Set up Node.js |
| 47 | + uses: actions/setup-node@v4 |
| 48 | + with: |
| 49 | + node-version: 20 |
| 50 | + |
| 51 | + - name: Restore Cache node_modules |
| 52 | + uses: actions/cache/restore@v4 |
| 53 | + with: |
| 54 | + path: '**/node_modules' |
| 55 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 56 | + |
| 57 | + - name: Run Lint |
| 58 | + run: npm run lint |
| 59 | + |
| 60 | + build: |
| 61 | + runs-on: ubuntu-latest |
| 62 | + needs: |
| 63 | + - install |
| 64 | + |
| 65 | + steps: |
| 66 | + - name: Checkout code |
| 67 | + uses: actions/checkout@v4 |
| 68 | + |
| 69 | + - name: Set up Node.js |
| 70 | + uses: actions/setup-node@v4 |
| 71 | + with: |
| 72 | + node-version: 20 |
| 73 | + |
| 74 | + - name: Restore Cache node_modules |
| 75 | + uses: actions/cache/restore@v4 |
| 76 | + with: |
| 77 | + path: '**/node_modules' |
| 78 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 79 | + |
| 80 | + - name: Cache dist |
| 81 | + uses: actions/cache/save@v4 |
| 82 | + with: |
| 83 | + path: 'libs/*/dist' |
| 84 | + key: ${{ runner.os }}-dist-${{ hashFiles('libs/*/dist') }} |
| 85 | + |
| 86 | + - name: Run Build |
| 87 | + run: npm run build |
| 88 | + |
| 89 | + test: |
| 90 | + runs-on: ubuntu-latest |
| 91 | + needs: |
| 92 | + - build |
| 93 | + |
| 94 | + steps: |
| 95 | + - name: Checkout code |
| 96 | + uses: actions/checkout@v4 |
| 97 | + |
| 98 | + - name: Set up Node.js |
| 99 | + uses: actions/setup-node@v4 |
| 100 | + with: |
| 101 | + node-version: 20 |
| 102 | + |
| 103 | + - name: Restore Cache node_modules |
| 104 | + uses: actions/cache/restore@v4 |
| 105 | + with: |
| 106 | + path: '**/node_modules' |
| 107 | + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
| 108 | + |
| 109 | + - name: Restore Cache dist |
| 110 | + uses: actions/cache/restore@v4 |
| 111 | + with: |
| 112 | + path: 'libs/*/dist' |
| 113 | + key: ${{ runner.os }}-dist-${{ hashFiles('libs/*/dist') }} |
| 114 | + |
| 115 | + - name: Run CI Checks |
| 116 | + run: npm run test |
0 commit comments