Skip to content

Commit

Permalink
Exploratory working directory change
Browse files Browse the repository at this point in the history
  • Loading branch information
sameagen-MW committed Dec 11, 2023
1 parent d091285 commit 05d9350
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,31 @@ jobs:
! grep "check" buildlog2.txt
rm buildlog.txt
rm buildlog2.txt
- name: Create second build file
run: |
mkdir new
cd new
cat <<'_EOF' >> "buildfile.m"
function plan = buildfile
plan = buildplan(localfunctions);
plan.DefaultTasks = "hello";
function helloTask(~)
disp("Hello world!");
_EOF
cd ..
- name: Run Build in subfolder
users: ./
with:
startup-options: -logfile log.txt
working-directory: new

- name: Verify correct build file ran
run: |
set -e
grep "Hello world!" log.txt
rm log.txt
rm new/buildfile.m
rmdir new
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ inputs:
Startup options for MATLAB
required: false
default: ""
working-directory:
description: >-
The directory in which to run the build
required: false
default: ""
runs:
using: node16
main: dist/index.js
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as buildtool from "./buildtool";
async function run() {
const platform = process.platform;
const architecture = process.arch;
const workspaceDir = process.cwd();
const workspaceDir = core.getInput("working-directory") || process.cwd();

const options: buildtool.RunBuildOptions = {
Tasks: core.getInput("tasks"),
Expand Down

0 comments on commit 05d9350

Please sign in to comment.