From d277ed3d9f598d3da6881f6b64d7ff9053063d99 Mon Sep 17 00:00:00 2001 From: "Eduardo M. Santos" Date: Wed, 27 Nov 2024 06:14:16 -0300 Subject: [PATCH] ci: simplify and standardize pipelines 1. Upgrade node version in release.yml 2. Merge 'ci.yml' and 'code-quality.yml' 3. Remove node-cache since the project is not complex enough for it to be required --- .github/workflows/ci.yml | 38 ++++++++++++----------------- .github/workflows/code-quality.yml | 39 ------------------------------ .github/workflows/release.yml | 2 +- 3 files changed, 16 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/code-quality.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 465f51c..734efbf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,16 +2,13 @@ name: CI on: push: - branches: - - main + branches: [main] pull_request: - branches: - - main + branches: [main] jobs: - build: - name: Test & Build - + quality: + name: Quality & Build runs-on: ubuntu-latest strategy: @@ -19,31 +16,26 @@ jobs: node-version: [22.x] steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: "npm" + cache: 'npm' - - name: Display Node.js version - run: node -v + - name: Setup Biome.js + uses: biomejs/setup-biome@v2 + with: + version: latest - name: Install dependencies run: npm ci - - name: Cache node_modules - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Run linting - run: npm run lint + - name: Run linting & formatting + run: | + npm run lint + npm run format - name: Run type-checking run: npm run check-types @@ -51,5 +43,5 @@ jobs: - name: Run tests run: npm test - - name: Build the package + - name: Build package run: npm run build diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml deleted file mode 100644 index 530980c..0000000 --- a/.github/workflows/code-quality.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Code Quality - -on: [pull_request] - -jobs: - quality: - name: Lint, Format & Organize - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [22.x] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install dependencies - run: npm ci - - - name: Cache node modules - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Setup Biome.js - uses: biomejs/setup-biome@v2 - with: - version: latest - - - name: Run linting - run: npm run lint - - - name: Run docs formating - run: npm run format diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b28e21..ab67334 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [22.x] permissions: contents: read # Allow reading repository contents