function addActions(gui, workspace) {
  // Visibility actions.
  gui.addAction(
    'Show',
    (workspace) => {
      workspace.setVisible(true);
    },
    'Visibility',
    'Show the workspace.',
  );
  gui.addAction(
    'Hide',
    (workspace) => {
      workspace.setVisible(false);
    },
    'Visibility',
    'Hide the workspace.',
  );

  // Block actions.
  gui.addAction(
    'Clear',
    (workspace) => {
      workspace.clear();
    },
    'Blocks',
    'Clear all the blocks from the workspace.',
  );
  gui.addAction(
    'Format',
    (workspace) => {
      workspace.cleanUp();
    },
    'Blocks',
    'Format the blocks on the workspace.',
  );

  // Undo/Redo actions.
  gui.addAction(
    'Undo',
    (workspace) => {
      workspace.undo();
    },
    'Undo/Redo',
    'Undo last action.',
  );
  gui.addAction(
    'Redo',
    (workspace) => {
      workspace.undo(true);
    },
    'Undo/Redo',
    'Redo last action.',
  );
  gui.addAction(
    'Clear Undo Stack',
    (workspace) => {
      workspace.clearUndo();
    },
    'Undo/Redo',
    'Clear the undo stack.',
  );

  // Scale actions.
  gui.addAction(
    'Zoom reset',
    (workspace) => {
      workspace.setScale(workspace.options.zoomOptions.startScale);
      workspace.scrollCenter();
    },
    'Scale',
    'Reset zoom.',
  );
  gui.addAction(
    'Zoom center',
    (workspace) => {
      workspace.scrollCenter();
    },
    'Scale',
    'Center the workspace.',
  );
  gui.addAction(
    'Zoom to Fit',
    (workspace) => {
      workspace.zoomToFit();
    },
    'Scale',
    'Zoom the blocks to fit in the workspace if possible.',
  );

  // Stress Test.
  gui.addAction(
    'Random Blocks',
    (workspace) => {
      populateRandom(workspace, 100);
    },
    'Stress Test',
    'Populate the workspace with a random set of blocks, for testing.',
  );
  gui.addAction(
    'Spaghetti!',
    (workspace) => {
      spaghetti(workspace, 8);
    },
    'Stress Test',
    'Populate the workspace with nested if-statement blocks, for testing.',
  );

  // Logging.
  gui.addCheckboxAction(
    'Log Events',
    function (workspace, value) {
      if (value) {
        enableLogger(workspace);
      } else {
        disableLogger(workspace);
      }
    },
    'Logging',
    false,
    'Toggle console logging of workspace events.',
  );
  gui.addCheckboxAction(
    'Log Flyout Events',
    function (workspace, value) {
      if (value) {
        if (workspace.getFlyout()) {
          enableLogger(workspace.getFlyout().getWorkspace());
        }
      } else {
        if (workspace.getFlyout()) {
          disableLogger(workspace.getFlyout().getWorkspace());
        }
      }
    },
    'Logging',
    false,
    'Toggle console logging of flyout events.',
  );
}
Add default actions to the GUI instance.
@param {?} gui The GUI instance.
@param {!Blockly.WorkspaceSvg} workspace The Blockly workspace.