Setup a CI pipeline

This action analyzes your C# code using Designite, detects a comprehensive set of architecture, design, and implementation smells, computes a large set of object-oriented code quality metrics, and uploads the results as an artifact.

Additionally, the action enables logging code quality analysis reports directly to DCode, our analytics platform. DCode automatically tracks and visualizes report trends, monitors code health, and supports data-driven engineering decisions.

1. Obtain Personal access token and add it to GitHub secrets

  • Create a new personal access token for your GitHub repository by navigating to your account’s user menu (top right) → Settings → Developer settings → Personal access tokens. Create a new token, and if using a fine-grained token, ensure read access to Actions, Code, and Metadata.

  • Add the token to your repository’s secrets by going to the repository’s Settings → Secrets and variables → Actions. Create a new secret, paste the token into the Value field, and assign a meaningful name (e.g., PAT).

2: Add your Designite key to secrets (optional)

If you have a Designite Professional or Academic license key, add it to your repository’s GitHub secrets as, for example, D_KEY. This key enables the analysis of large projects.

3: Add your DCode project credentials to secrets (optional)

Create a new project in DCode, if not exists yet, and retrieve the project-id and api-key from the project settings page (accessible via the three dots on the project card). Add these values to your repository’s GitHub secrets as PROJECT_ID and API_KEY. This setup allows your code quality analysis reports to be automatically logged to your DCode project, where you can monitor trends and track code health.

4: Add a GitHub Actions workflow file

This is the last and very crucial step. Create a folder .github on your root directory of the project and create workflows folder inside the .github folder. Create a workflow file (say actions.yml) in the newly created workflows folder. The contents of the action.yml file depend on your project language and tasks.

A sample action file is provided below.

name: CI

on:
push:
    branches: [ main ]
pull_request:
    branches: [ main ]

jobs:
analyze:
    runs-on: windows-latest
    steps:
    - name: DesigniteAction
        uses: DesigniteTools/designite_action@v1.2.0
        with:
            PAT: ${{ secrets.PAT }}
            PROJECT_ID: ${{ secrets.PROJECT_ID }}
            API_KEY: ${{ secrets.API_KEY }}

Change the version number of action.

What you’ll get

Once configured, your repository will be analyzed on each event defined in your workflow file (in the example above, the analysis runs on every push or pull request to the main branch). The resulting report will be stored as a GitHub Actions artifact, which you can download later to review detected code quality smells and metrics for deeper analysis.

If integrated with DCode, you can automatically track code quality over time. DCode provides interactive visualizations to help you understand and monitor code health, enabling data-driven engineering decisions.