Skip to content

Conversation

@mcafaro
Copy link
Member

@mcafaro mcafaro commented Jun 25, 2025

This change adds a commented out run-build and run-command step to all generated workflows.

I experimented with giving an option for choosing the type of step you what to use on the generator webpage, but it complicated the simple one-field, one-button, interface I would like to maintain.

Note the README.md is touched because prettier is auto-formatting it. I prefer just having prettier maintain all formatting in this repo so we don't have to worry about it.

A generated workflow with all options now looks like this:

# This workflow was generated using the GitHub Actions Workflow Generator for MATLAB.
# See https://matlab-actions.github.io/workflow-generator

name: MATLAB

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  workflow_dispatch: {}

jobs:
  build:
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v4
      
      - name: Set up MATLAB
        uses: matlab-actions/setup-matlab@v2
        with:
          # Set up additional products using the products input.
          # See https://github.com/matlab-actions/setup-matlab/#set-up-matlab
          # products: Simulink Deep_Learning_Toolbox
          cache: true

      - name: Run MATLAB tests
        uses: matlab-actions/run-tests@v2
        # If you are not using a MATLAB project, add your source code to the path using the source-folder input.
        # with:
        #   source-folder: myfolder1; myfolder2

      # Alternatively, use the run-build action to run the tasks in your buildfile.m.
      # - name: Run MATLAB build
      #   uses: matlab-actions/run-build@v2
      #   with:
      #     tasks: test

      # Alternatively, use the run-command action to run MATLAB scripts, functions, and statements.
      # - name: Run MATLAB command
      #   uses: matlab-actions/run-command@v2
      #   with:
      #     command: results = runtests('IncludeSubfolders',true); assertSuccess(results);

- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
with:
# Set up additional products using the 'products' input.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike run-build, run-command, and MLM_LICENSE_TOKEN, products is quoted here.

Can we be consistent? If you like to show these as literal values, enclose them in backtips (``) instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you feel about just removing the quotes on products?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should works.

# with:
# tasks: test
# Use run-command to run MATLAB scripts, functions, and statements.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the run-command action?

- name: Run MATLAB tests
uses: matlab-actions/run-tests@v2
# Use run-build to invoke the MATLAB build tool if you have a buildfile.m.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the run-build action to run the tasks in your build file named buildfile.m?

(Try to avoid "invoke" and "a buildfile.m")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the run-build action to run the tasks in your buildfile.m?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@mcafaro mcafaro merged commit be1e0cc into main Jun 26, 2025
1 check passed
@mcafaro mcafaro deleted the run-command branch June 26, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants