diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..94ed684 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + types: [opened, synchronize] + +jobs: + build: + name: Build and Test + timeout-minutes: 15 + runs-on: ubuntu-latest + # To use Remote Caching, uncomment the next lines and follow the steps below. + # env: + # TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + # TURBO_TEAM: ${{ vars.TURBO_TEAM }} + + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm build + + - name: Test + run: pnpm test diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 31835eb..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: CI - -on: push - -jobs: - validate: - runs-on: ubuntu-latest - - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Cache dependencies ⚡ - id: cache - uses: actions/cache@v4 - with: - path: node_modules - key: node-modules-${{ hashFiles('pnpm-lock.yaml') }} - - - name: Install dependencies 🔧 - if: steps.cache.outputs.cache-hit != 'true' - run: pnpm ci - - - name: Lint ✅ - run: pnpm run lint - - - name: Build 🏗️ - run: pnpm run build \ No newline at end of file