From b223d439b1f92fe8b3e0b1c2a02af19e104da83b Mon Sep 17 00:00:00 2001 From: diy0r Date: Thu, 5 Sep 2024 00:01:45 +0500 Subject: [PATCH] chore: optimize commit lint --- .github/workflows/checker.yaml | 43 ++++++++++++++-------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/.github/workflows/checker.yaml b/.github/workflows/checker.yaml index 131e413..93c8a35 100644 --- a/.github/workflows/checker.yaml +++ b/.github/workflows/checker.yaml @@ -15,23 +15,23 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Install required dependencies - run: | - sudo apt update - sudo apt install -y sudo - sudo apt install -y git curl - curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - - sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs - - name: Print versions - run: | - git --version - node --version - npm --version - npx commitlint --version + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - 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: Install commitlint run: | - npm install conventional-changelog-conventionalcommits - npm install commitlint@latest + npm install -g commitlint@latest @commitlint/{config-conventional,cli}@latest - name: Validate current commit (last commit) with commitlint if: github.event_name == 'push' @@ -46,23 +46,16 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: - - 20 - - 21 - - 22 - os: - - ubuntu-latest - - windows-latest - - macos-latest + node-version: [20.x] steps: - uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} - - name: Use Node.js ${{ matrix.node }} + - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node }} + node-version: ${{ matrix.node-version }} - name: Install dependencies run: npm install