diff --git a/.github/actions/setup-node/action.yaml b/.github/actions/setup-node/action.yaml index fbe9069..7519379 100644 --- a/.github/actions/setup-node/action.yaml +++ b/.github/actions/setup-node/action.yaml @@ -18,26 +18,32 @@ runs: # Composite actions cannot use secrets, and are logged as a single step. using: 'composite' steps: - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ inputs.node-version }} - - - uses: pnpm/action-setup@v4 + - name: '🔧 Install: pnpm' + uses: pnpm/action-setup@v4 with: version: ${{ inputs.pnpm-version }} run_install: false standalone: true dest: ~/setup-pnpm - - name: Cache pnpm modules + - name: 🔺️ Cache (turbo) uses: actions/cache@v4 with: - path: ~/.pnpm-store - key: ${{ runner.os }}-${{ matrix.node }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} + path: .turbo + key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-${{ matrix.node }}-node- + ${{ runner.os }}-turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }} + ${{ runner.os }}-turbo-${{ github.job }}-${{ github.ref_name }} + ${{ runner.os }}-turbo-${{ github.job }} + ${{ runner.os }}-turbo - - name: Install dependencies - run: pnpm install --frozen-lockfile + - name: '💽️ Setup Node.js' + uses: actions/setup-node@v4 + with: + cache-dependency-path: pnpm-lock.yaml + cache: 'pnpm' + node-version: ${{ inputs.node-version }} + + - name: '📦️ Install Dependencies' shell: bash + run: pnpm install --frozen-lockfile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9eb1989..e8beb9f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: CI workflow +name: ' ▶️ CI Workflow' on: push: @@ -11,6 +11,10 @@ on: - 'README.md' workflow_dispatch: +concurrency: + group: pull-${{ github.ref }}-1 + cancel-in-progress: true + env: CI: "true" @@ -38,17 +42,20 @@ jobs: with: fetch-depth: 0 - - name: Setup (Node.js) + - name: '💽️ Setup (Node.js)' uses: ./.github/actions/setup-node with: node-version: ${{ matrix.node }} pnpm-version: ${{ matrix.pnpm }} - - name: Transpile TS to JS - run: pnpm build + - name: '🏗️ Build: Transpile TS to JS' + run: pnpm check:exports + + - name: '🧪 Verify build' + run: pnpm check:exports - - name: Lint code + - name: '🚨️ Lint code' run: pnpm lint:ci - - name: Run unit tests + - name: '🧳 Run unit tests' run: pnpm test:unit