|
1 | 1 | # Action for Running MATLAB Tests |
2 | | -The [Run MATLAB Tests](#run-matlab-tests) action enables you to run MATLAB® and Simulink® tests and generate test and coverage artifacts on a [self-hosted](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners) or [GitHub®-hosted](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners) runner: |
3 | | -- To use a self-hosted runner, you must set up a computer with MATLAB as your self-hosted runner and register the runner with GitHub Actions. The runner uses the topmost MATLAB release on the system path to execute your workflow. |
4 | | -- To use a GitHub-hosted runner, you must include the [Setup MATLAB](https://github.com/matlab-actions/setup-matlab/) action in your workflow to set up your preferred MATLAB release (R2021a or later) on the runner. |
5 | | - |
| 2 | +The [Run MATLAB Tests](#run-matlab-tests) action enables you to run MATLAB® and Simulink® tests and generate test and coverage artifacts on a [GitHub®-hosted](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners) or [self-hosted](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners) runner: |
| 3 | +- To use a GitHub-hosted runner, include the [Setup MATLAB](https://github.com/matlab-actions/setup-matlab/) action in your workflow to set up your preferred MATLAB release (R2021a or later) on the runner. |
| 4 | +- To use a self-hosted runner, set up a computer with MATLAB on its path and register the runner with GitHub Actions. (On self-hosted UNIX® runners, you can also use the **Setup MATLAB** action instead of having MATLAB already installed.) The runner uses the topmost MATLAB release on the system path to execute your workflow. |
6 | 5 |
|
7 | 6 | ## Examples |
8 | 7 | Use the **Run MATLAB Tests** action to automatically run tests authored using the MATLAB unit testing framework or Simulink Test™. You can use this action with optional inputs to generate various test and coverage artifacts. |
9 | 8 |
|
10 | 9 | ### Run Tests in MATLAB Project |
11 | | -On a self-hosted runner, run the tests in your [MATLAB project](https://www.mathworks.com/help/matlab/projects.html). To run the tests, specify the **Run MATLAB Tests** action in your workflow. |
| 10 | +On a self-hosted runner that has MATLAB installed, run the tests in your [MATLAB project](https://www.mathworks.com/help/matlab/projects.html). To run the tests, specify the **Run MATLAB Tests** action in your workflow. |
12 | 11 |
|
13 | 12 | ```yaml |
14 | 13 | name: Run Tests in MATLAB Project |
@@ -73,14 +72,14 @@ jobs: |
73 | 72 | ``` |
74 | 73 |
|
75 | 74 | ### Use MATLAB Batch Licensing Token |
76 | | -On a GitHub-hosted runner, you need a [MATLAB batch licensing token](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/alternates/non-interactive/MATLAB-BATCH.md#matlab-batch-licensing-token) if your project is private or if your workflow includes transformation products, such as MATLAB Coder™ and MATLAB Compiler™. Batch licensing tokens are strings that enable MATLAB to start in noninteractive environments. You can request a token by submitting the [MATLAB Batch Licensing Pilot](https://www.mathworks.com/support/batch-tokens.html) form. |
| 75 | +When you define a workflow using the [Setup MATLAB](https://github.com/matlab-actions/setup-matlab/) action, you need a [MATLAB batch licensing token](https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/alternates/non-interactive/MATLAB-BATCH.md#matlab-batch-licensing-token) if your project is private or if your workflow includes transformation products, such as MATLAB Coder™ and MATLAB Compiler™. Batch licensing tokens are strings that enable MATLAB to start in noninteractive environments. You can request a token by submitting the [MATLAB Batch Licensing Pilot](https://www.mathworks.com/support/batch-tokens.html) form. |
77 | 76 |
|
78 | 77 | To use a MATLAB batch licensing token: |
79 | 78 |
|
80 | 79 | 1. Set the token as a secret. For more information about secrets, see [Using secrets in GitHub Actions](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions). |
81 | 80 | 2. Map the secret to an environment variable named `MLM_LICENSE_TOKEN` in your workflow. |
82 | 81 |
|
83 | | -For example, use the latest release of MATLAB on a GitHub-hosted runner to run the tests in your private project. To set up the latest release of MATLAB on the runner, specify the [Setup MATLAB](https://github.com/matlab-actions/setup-matlab/) action in your workflow. To run the tests, specify the **Run MATLAB Tests** action. In this example, `MyToken` is the name of the secret that holds the batch licensing token. |
| 82 | +For example, use the latest release of MATLAB on a GitHub-hosted runner to run the tests in your private project. To set up the latest release of MATLAB on the runner, specify the **Setup MATLAB** action in your workflow. To run the tests, specify the **Run MATLAB Tests** action. In this example, `MyToken` is the name of the secret that holds the batch licensing token. |
84 | 83 |
|
85 | 84 | ```YAML |
86 | 85 | name: Use MATLAB Batch Licensing Token |
|
0 commit comments