Merge pull request #1779 from carbon-design-system/fix/page-not-found… #4133
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Checks | |
on: | |
push: | |
branches: | |
- main | |
- next | |
pull_request: | |
types: [opened, synchronize, reopened] | |
env: | |
CI: 'true' | |
# | |
# Limit workflow to a single running instance at a time | |
# | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# | |
# Ensure all files pass linting | |
# | |
lint: | |
name: Prettier, ESLint, Stylelint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎 | |
uses: actions/checkout@v4 | |
- name: Setup Node 🏗 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: Install Node Modules 🔧 | |
run: | | |
npm --workspaces=false install | |
npm ---workspace packages/eslint-plugin-carbon-platform install | |
- name: Lint 🔎 | |
run: npm run lint | |
# | |
# Ensure all packages and services build properly | |
# | |
build: | |
name: Build packages and services | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎 | |
uses: actions/checkout@v4 | |
- name: Setup Node 🏗 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: Install Node Modules 🔧 | |
run: npm install | |
- name: Build 🔨 | |
run: npm run all:build | |
# | |
# Ensure all unit tests pass | |
# | |
test: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎 | |
uses: actions/checkout@v4 | |
- name: Setup Node 🏗 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: Install Node Modules 🔧 | |
run: npm install | |
- name: Build packages 🔨 | |
run: npm run packages:build | |
- name: Test 🧪 | |
run: npm run test | |
- name: Upload test coverage reports 🛫 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-coverage | |
path: '**/.test-coverage/lcov.info' | |
# | |
# Check code quality and test coverage | |
# | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout 🛎 | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Disable shallow clones for better relevancy of analysis | |
- name: Download test coverage reports 🛬 | |
uses: actions/download-artifact@v3 | |
with: | |
name: test-coverage | |
- name: SonarCloud scan 🔎 | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |