From bd512fcb6b7f57070795729113ad7a672c0c2b7f Mon Sep 17 00:00:00 2001 From: Josh Rose Date: Thu, 8 Feb 2024 11:14:57 +0100 Subject: [PATCH 1/4] fix: split build and lint to speed up feedback loop and martch mergify --- .github/workflows/ci.yml | 88 ++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa6ff66..499f279 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,36 +1,54 @@ --- - name: CI - on: - pull_request: - branches: ['main'] - jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - cache: 'npm' - - run: npm ci - - run: npm run build - - run: cd example && npm ci - - name: Lint Code Base - uses: github/super-linter/slim@v5 - env: - DISABLE_V8_COMPILE_CACHE: true - DEFAULT_BRANCH: 'main' - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.cjs - LINTER_RULES_PATH: / - TYPESCRIPT_ES_CONFIG_FILE: .eslintrc.cjs - CSS_FILE_NAME: stylelint.config.cjs - VALIDATE_ALL_CODEBASE: false - VALIDATE_JAVASCRIPT_STANDARD: false - VALIDATE_JSCPD: false - VALIDATE_JSX: false - VALIDATE_TSX: false - VALIDATE_TYPESCRIPT_STANDARD: false +name: CI +on: + pull_request: + branches: ['main'] +permissions: + contents: read +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: 'npm' + - name: Install Dependencies + run: npm ci + - name: Build Diamond + run: npm run build + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: 'npm' + - name: Install Dependencies + run: npm ci && cd example && npm ci + - name: Lint Code Base + uses: github/super-linter/slim@v5 + env: + DISABLE_V8_COMPILE_CACHE: true + DEFAULT_BRANCH: 'main' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.cjs + LINTER_RULES_PATH: / + TYPESCRIPT_ES_CONFIG_FILE: .eslintrc.cjs + CSS_FILE_NAME: stylelint.config.cjs + VALIDATE_ALL_CODEBASE: false + VALIDATE_JAVASCRIPT_STANDARD: false + VALIDATE_JSCPD: false + VALIDATE_JSX: false + VALIDATE_TSX: false + VALIDATE_TYPESCRIPT_STANDARD: false From c775c4230b49e39e09e5b02158746cb6a6d8a8d4 Mon Sep 17 00:00:00 2001 From: Josh Rose Date: Thu, 8 Feb 2024 11:17:59 +0100 Subject: [PATCH 2/4] feat: link to sonarcloud --- .vscode/settings.json | 4 ++++ README.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 5d27126..cd5362c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,9 @@ "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit", "source.fixAll.stylelint": "explicit" + }, + "sonarlint.connectedMode.project": { + "connectionId": "etchteam", + "projectKey": "etchteam_diamond-ui" } } diff --git a/README.md b/README.md index bac014e..4bd044b 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ # Diamond UI + +[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=etchteam_diamond-ui&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=etchteam_diamond-ui) +[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=etchteam_diamond-ui&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=etchteam_diamond-ui) +[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=etchteam_diamond-ui&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=etchteam_diamond-ui) From 3eb75bf67a4b4371847226376fd0c2da960c8387 Mon Sep 17 00:00:00 2001 From: Josh Rose Date: Thu, 8 Feb 2024 11:27:23 +0100 Subject: [PATCH 3/4] feat: remove fetch-depth for build task --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 499f279..beade69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,8 +11,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Setup node uses: actions/setup-node@v4 with: From 5415256b7ad7eb332cc063ed9b68dc334834d8a6 Mon Sep 17 00:00:00 2001 From: Josh Rose Date: Thu, 8 Feb 2024 11:28:07 +0100 Subject: [PATCH 4/4] feat: add concurrency --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index beade69..4c2104e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,9 @@ on: branches: ['main'] permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: build: runs-on: ubuntu-latest