|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '**' |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - '**' |
| 10 | + |
| 11 | +jobs: |
| 12 | + lint: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - uses: actions/setup-node@v4 |
| 18 | + with: |
| 19 | + node-version: '20' |
| 20 | + |
| 21 | + - name: Cache node_modules |
| 22 | + id: cache-modules |
| 23 | + uses: actions/cache@v4 |
| 24 | + with: |
| 25 | + path: '**/node_modules' |
| 26 | + key: node-modules-${{ hashFiles('**/yarn.lock') }} |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: yarn install --frozen-lockfile |
| 30 | + |
| 31 | + - name: Lint |
| 32 | + run: yarn lint |
| 33 | + |
| 34 | + test: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + |
| 39 | + - uses: actions/setup-node@v4 |
| 40 | + with: |
| 41 | + node-version: '20' |
| 42 | + |
| 43 | + - name: Cache node_modules |
| 44 | + id: cache-modules |
| 45 | + uses: actions/cache@v4 |
| 46 | + with: |
| 47 | + path: '**/node_modules' |
| 48 | + key: node-modules-${{ hashFiles('**/yarn.lock') }} |
| 49 | + |
| 50 | + - name: Install dependencies |
| 51 | + run: yarn install --frozen-lockfile |
| 52 | + |
| 53 | + - name: Unit Tests |
| 54 | + run: yarn test:ci |
| 55 | + |
| 56 | + release: |
| 57 | + needs: [lint, test] |
| 58 | + if: github.ref == 'refs/heads/main' && github.event_name == 'push' |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + with: |
| 63 | + fetch-depth: 0 |
| 64 | + |
| 65 | + - uses: actions/setup-node@v4 |
| 66 | + with: |
| 67 | + node-version: '20' |
| 68 | + |
| 69 | + - name: Cache node_modules |
| 70 | + id: cache-modules |
| 71 | + uses: actions/cache@v4 |
| 72 | + with: |
| 73 | + path: '**/node_modules' |
| 74 | + key: node-modules-${{ hashFiles('**/yarn.lock') }} |
| 75 | + |
| 76 | + - name: Install dependencies |
| 77 | + run: yarn install --frozen-lockfile |
| 78 | + |
| 79 | + - name: Configure git |
| 80 | + run: | |
| 81 | + git config --global user.email "instantsearch-bot@algolia.com" |
| 82 | + git config --global user.name "Algolia" |
| 83 | +
|
| 84 | + - name: Trigger Ship.js release |
| 85 | + run: yarn shipjs trigger |
| 86 | + env: |
| 87 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments