Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build options #16

Merged
merged 25 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions .github/workflows/bat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ jobs:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"
- name: Perform npm tasks
run: npm run ci

- name: Perform 'setup-matlab'
uses: matlab-actions/setup-matlab@v1
uses: matlab-actions/setup-matlab@v2

- name: Create buildfile.m in project root for tests
run: |
Expand All @@ -37,6 +37,10 @@ jobs:

function checkTask(~)
f = fopen('buildlog.txt', 'a+'); fprintf(f, 'checking\n'); fclose(f);

function errorTask(~)
f = fopen('buildlog.txt', 'a+'); fprintf(f, 'erroring\n'); fclose(f);
error('Error occured in errorTask');
_EOF

- name: Run build with default tasks
Expand Down Expand Up @@ -93,3 +97,35 @@ jobs:
! grep "check" buildlog2.txt
rm buildlog.txt
rm buildlog2.txt

- name: Run build with task skipping
uses: ./
with:
tasks: deploy
build-options: -skip test

- name: Verify correct tasks appear in buildlog.txt
run: |
set -e
grep "building" buildlog.txt
! grep "testing" buildlog.txt
grep "deploying" buildlog.txt
! grep "checking" buildlog.txt
rm buildlog.txt

- name: Run build with continue on failure
continue-on-error: true
uses: ./
with:
tasks: error deploy
build-options: -continueOnFailure

- name: Verify correct tasks appear in buildlog.txt
run: |
set -e
grep "erroring" buildlog.txt
grep "building" buildlog.txt
grep "testing" buildlog.txt
grep "deploying" buildlog.txt
! grep "checking" buildlog.txt
rm buildlog.txt
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
tag: ${{ steps.update-package-version.outputs.version }}
steps:
# Configure runner with the right stuff
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure git
run: |
git config user.name 'Release Action'
git config user.email '<>'
- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "20"

# Call `npm version`. It increments the version and commits the changes.
# We'll save the output (new version string) for use in the following
Expand Down
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022-2023 The MathWorks, Inc.
# Copyright 2022-2024 The MathWorks, Inc.

name: Run MATLAB Build
description: >-
Expand All @@ -9,11 +9,16 @@ inputs:
Space-separated list of tasks to run
required: false
default: ""
build-options:
description: >-
Build options for MATLAB build tool
required: false
default: ""
startup-options:
description: >-
Startup options for MATLAB
required: false
default: ""
runs:
using: node16
using: node20
main: dist/index.js
Loading
Loading