From 1e368ee18abb101bfbacfd401892d786540ed07d Mon Sep 17 00:00:00 2001 From: Rubin Bhandari Date: Mon, 28 Oct 2024 07:55:33 +0545 Subject: [PATCH] Update github-ci.yml --- .github/workflows/github-ci.yml | 107 +++++++++++++++++++++++--------- 1 file changed, 77 insertions(+), 30 deletions(-) diff --git a/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml index 3c41dd32..a3d1c945 100644 --- a/.github/workflows/github-ci.yml +++ b/.github/workflows/github-ci.yml @@ -1,40 +1,87 @@ name: CI -on: [push, pull_request] + +on: + push: + branches: + - master + + pull_request: + branches: + - master jobs: - build: + lint: runs-on: ubuntu-latest steps: - - uses: pnpm/action-setup@v4 - name: Install pnpm - - uses: actions/setup-node@v4 - name: Install node + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v3 + + - name: Set node + uses: actions/setup-node@v4 with: - node-version: 20.x - cache: pnpm - - run: pnpm install --shamefully-hoist - - run: pnpm build - - release: - name: release - if: ${{ github.ref == 'refs/heads/master' }} - needs: - - build + node-version: lts/* + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Lint + run: nr lint + + typecheck: runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v4 - id: release + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v3 + + - name: Set node + uses: actions/setup-node@v4 with: - release-type: node - package-name: ultimate-nest + node-version: lts/* + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Typecheck + run: nr typecheck + + test: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + node: [lts/*] + os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + + steps: - uses: actions/checkout@v4 - - name: tag stable versions - if: ${{ steps.release.outputs.release_created }} - run: | - git config user.name github-actions[bot] - git config user.email github-actions[bot]@users.noreply.github.com - git remote add gh-token "https://${{ secrets.TOKEN_GITHUB }}@github.com/google-github-actions/release-please-action.git" - git tag -d stable || true - git push origin :stable || true - git tag -a stable -m "Last Stable Release" - git push origin stable + + - name: Install pnpm + uses: pnpm/action-setup@v3 + + - name: Set node ${{ matrix.node }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Build + run: nr build + + - name: Test + run: nr test