Skip to content

Github Action Test Design Automation

🕒 Published at:


If you are working with Autodesk Design Automation, this article is an ideal resource for you to explore its underlying aspects further. In this article, we will delve into the execution code of Design Automation automatically, along with the automatic results retrieval through GitHub Actions. This way, we can minimize risks and ensure integrity during the transition, extracting data from the developer side before the official release to users.

Why Github Action

Yes, we can run test at the local machine, but bellow is some reason why we should use Github Action for test Design Automation :

  • We can run test on multiple platform (Windows, Linux, MacOs)

  • We can run test on multiple version of .NET (5.0, 6.0)

  • Easier to collaborate with other developer.

  • We don't need setup environment for each developer machine, just need to setup once for Github Action.

  • We know issue early, when we push code to repository, Github Action will run test automatically and send result to us.

  • Protect your secret intergrade on cloud .

In this article, we will use .NET 6.0 and Ubuntu 20.04 for test Design Automation. In real case project we should test on multiple platform and multiple version of .NET depend on your setting configuration.

Project Setup

Ensure that your project includes executable functions through Unit Test.

Let's take an example where I want to test the automatic extraction of room data from BIM 360 during the development process:

[TestCase("b.ca790fb5-141d-4ad5-b411-0461af2e9748", "urn:adsk.wipprod:fs.file:vf.HX2O8xKUxfukJ_hgHsrX_A",35,35)]
public async Task RevitDesignAutomateRoomTest(string projectId, string urn,int startVersion,int endVersion)
       string forgeToken = await ForgeService.Get2LeggedToken(configuration.ClientId,configuration.ClientSecret);
        Status executeJob = // DO SOMETHING With YOUR TEST HERE
        Assert.IsTrue(executeJob == Status.Success);

Github Action

Below is a template that allows the execution of code automatically through GitHub Action. To use this template, you need to provide information such as APS_CLIENT_ID and APS_CLIENT_SECRET through GitHub Secrets.

The workflow.yml file should be placed in the .github/workflows directory of your repository. Now, let's include environment variables in the workflow.yml file:

  APS_CLIENT_ID: ${{ secrets.APS_CLIENT_ID }}

This is how the workflow.yml file looks like:

name: .NET

    branches: [ "dev" ]
    branches: [ "dev" ]


    runs-on: ubuntu-latest

    - uses: actions/checkout@v3
    - name: Setup .NET
      uses: actions/setup-dotnet@v3
        dotnet-version: 6.0.x
    - name: Restore dependencies
      run: dotnet restore
    - name: Build
      run: dotnet build --no-restore
    - name: Test
        dotnet test --no-build --verbosity normal
        APS_CLIENT_ID: ${{ secrets.APS_CLIENT_ID }}

The returned test results will be displayed as follows, depending on your Console.WriteLine adjustments. Below is an example of a test executed on the Ubuntu platform through GitHub Action with the RevitDesignAutomateRoomTest method:

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
NUnit Adapter Test execution started
Running all tests in /home/runner/work/forge-client/forge-client/AutomationUnitTest/bin/Debug/net6.0/AutomationUnitTest.dll
   NUnit3TestExecutor discovered 2 of 2 NUnit test cases using Current Discovery mode, Non-Explicit run
  Passed TestAuthentication [1 s]
Is Composite Design: False
Retrieving app bundles
Found existing app bundle: chuong.ExtractRoomAppNew+dev
Start Retrieving activity
Found existing activity, id : chuong.ExtractRoomAppNewActivity+dev
ActivityId: chuong.ExtractRoomAppNewActivity+dev
Download URL:
Start Create WorkItem
WorkItemStatus: Pending
Working Item Id: e2b90b36d2574ac4baff59315790e807
Status: Pending
WorkItemStatus: Success

NUnit Adapter Test execution complete
  Passed RevitDesignAutomateRoomTest("b.ca790fb5-141d-4ad5-b411-0461af2e9748","urn:adsk.wipprod:fs.file:vf.HX2O7xKUQfukJ_hgHsrX_A",35,35) [2 m 7 s]

Test Run Successful.
Total tests: 2
     Passed: 2
 Total time: 2.1915 Minutes

This is how Github Action look like :

You can use for test Authentication, Create Activity, Create WorkItem, Get Result, etc.

    public void TestAuthentication()
        string clientId = Environment.GetEnvironmentVariable("APS_CLIENT_ID");
        string clientSecret = Environment.GetEnvironmentVariable("APS_CLIENT_SECRET");
        // Your Code Here
        //Task<string> get2LeggedToken = ForgeService.Get2LeggedToken(clientId, clientSecret);
        //string token = get2LeggedToken.Result;


Note that automatically executed code also implies incurring corresponding costs for Design Automation during execution. Therefore, careful consideration is necessary before usage, along with thoughtful consideration of employing crucial test templates.