From 74e12da9435f4d5235f68bd9258d223f25bec5c1 Mon Sep 17 00:00:00 2001 From: Hugos68 Date: Fri, 10 Jan 2025 13:22:50 +0100 Subject: [PATCH] CI/CD cleanup --- .github/workflows/code-quality.yml | 136 ++++++++--------------- .github/workflows/publish-package.yml | 54 +++++---- packages/floating-ui-svelte/package.json | 4 +- 3 files changed, 72 insertions(+), 122 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 592774c9..1c55ef1c 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -2,115 +2,69 @@ name: Code Quality on: pull_request: - branches: - - main jobs: - setup: - name: Setup - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - - - name: Install pnpm - uses: pnpm/action-setup@v3 - with: - version: 'latest' - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - name: Setup pnpm cache - uses: actions/cache@v4 - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install --frozen-lockfile - format: name: Format - needs: setup - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 + strategy: + matrix: + node-version: latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - + - uses: actions/checkout@v4 - name: Install pnpm - uses: pnpm/action-setup@v3 + uses: pnpm/action-setup@v4 with: - version: 'latest' - run_install: false - + version: 10 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Run Formatter run: pnpm format:check - test: - name: Test - needs: setup - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - - - name: Install pnpm - uses: pnpm/action-setup@v3 - with: - version: 'latest' - run_install: false - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Run tests - run: pnpm test + name: Format + runs-on: ubuntu-22.04 + strategy: + matrix: + node-version: latest + steps: + - uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Run tests + run: pnpm test build: - name: Build - needs: setup - runs-on: ubuntu-latest + name: Format + runs-on: ubuntu-22.04 + strategy: + matrix: + node-version: latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - + - uses: actions/checkout@v4 - name: Install pnpm - uses: pnpm/action-setup@v3 + uses: pnpm/action-setup@v4 with: - version: 'latest' - run_install: false - + version: 10 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Build project run: pnpm build \ No newline at end of file diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 61ae8317..429a070b 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -7,31 +7,29 @@ on: jobs: publish: - name: Publish - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - - - name: Install pnpm - uses: pnpm/action-setup@v3 - with: - version: 'latest' - run_install: false - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@v1 - with: - publish: pnpm changeset publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + name: Format + runs-on: ubuntu-22.04 + strategy: + matrix: + node-version: latest + steps: + - uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + publish: pnpm changeset publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/packages/floating-ui-svelte/package.json b/packages/floating-ui-svelte/package.json index 6a8cd6e9..6dfa0f6f 100644 --- a/packages/floating-ui-svelte/package.json +++ b/packages/floating-ui-svelte/package.json @@ -8,9 +8,7 @@ "test:watch": "pnpm test --watch", "sync": "svelte-kit sync && pnpm build" }, - "files": [ - "dist" - ], + "files": ["dist"], "sideEffects": false, "svelte": "./dist/index.js", "types": "./dist/index.d.ts",