Part 3: CI/CD pipeline with MuleSoft and GitHub Actions - MUnit testing
In this post:
In the previous article, we learned how to add a decryption key to your CI/CD pipeline to be able to decrypt your encrypted properties at runtime. If you haven’t been following the series or you’re not familiar with GitHub Actions, we recommend you start from the first article to understand how we are setting up all the configurations we need.
In this post, we’ll see the steps to create a pipeline with GitHub Actions that will run the MUnit tests you have set up in your Mule project.
ℹ️ Note: We will talk about coverage percentage in the next article. We’ll only focus on creating the basic testing configuration in this post.
Prerequisites
You should already have all the setup in your Mule application for running the MUnits. In summary, this is what you should already have:
The required dependencies, plugins, or properties in your pom.xml to be able to run MUnits for your Mule project.
The working MUnit tests under src/test/munit.
Enterprise Nexus credentials to run the MUnits in the CI/CD pipeline. For more information see this question. Note that we didn’t need these credentials before but we need them to be able to run the tests because of some dependencies.
⚠️ Important: Make sure your MUnit tests work locally (from Anypoint Studio) before attempting to create the pipeline. Otherwise, you might encounter some issues.
ℹ️ Note: You do not need Nexus credentials to run the MUnits from Studio, only to run them with Maven.
Set up your credentials
In your GitHub repository, go to the Settings tab (make sure you are signed in to see it). Now go to Secrets and variables > Actions. Here you will be able to set up your repository secrets.
In the previous articles, we added the following actions secrets:
ANYPOINT_PLATFORM_PASSWORD
ANYPOINT_PLATFORM_USERNAME
DECRYPTION_KEY
For this post, we’re going to add two more secrets for the nexus credentials:
NEXUS_USERNAME
NEXUS_PASSWORD
Click on New repository secret. In the Name field, write the name of the secret. In the Secret field, write the actual value of your key (your Nexus username/password). Click Add secret.
Please make sure your Nexus credentials are valid before continuing. To verify this, go to this site and sign in.

You should be able to see the welcome page after logging in.
