Skip to content

Commit

Permalink
Merge pull request #16 from ocefpaf/GHA_test
Browse files Browse the repository at this point in the history
Add GitHub Actions testing
  • Loading branch information
ocefpaf committed Apr 22, 2024
2 parents 7709377 + dee3990 commit ac8e71a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 11 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "Bot"
15 changes: 15 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Tests

on: [push, pull_request]

jobs:
my-job:
name: Run MATLAB Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: matlab-actions/setup-matlab@v2
- name: Run Tests
uses: matlab-actions/run-command@v2
with:
command: run_checks
22 changes: 11 additions & 11 deletions Toolbox/gsw_check_functions.m
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
if isempty(which('gsw_gibbs.html'))
fprintf(2,'You need to add the GSW "html" subdirectory to your path. \n');
end
% if isempty(which('gsw_gibbs.html'))
% fprintf(2,'You need to add the GSW "html" subdirectory to your path. \n');
% end

if isempty(which('gsw_gibbs.m'))
fprintf(2,'You need to add the GSW "library" subdirectory to your path. \n');
end

if isempty(which('gibbs.pdf'))
fprintf(2,'You need to add the GSW "pdf" subdirectory to your path. \n');
end
% if isempty(which('gibbs.pdf'))
% fprintf(2,'You need to add the GSW "pdf" subdirectory to your path. \n');
% end

if isempty(which('gsw_rho_t_exact.m'))
fprintf(2,'You need to add the GSW "thermodynamics_from_t" subdirectory to your path. \n');
end

if isempty(which('gsw_gibbs.html')) | isempty(which('gsw_gibbs.m')) | ...
isempty(which('gibbs.pdf')) | isempty(which('gsw_rho_t_exact.m'))
error('You have not added the GSW subdirectories to you MATLAB Path')
end
% if isempty(which('gsw_gibbs.html')) | isempty(which('gsw_gibbs.m')) | ...
% isempty(which('gibbs.pdf')) | isempty(which('gsw_rho_t_exact.m'))
% error('You have not added the GSW subdirectories to you MATLAB Path')
% end

try
gsw_installation_dir = which ('gsw_gibbs.html');
Expand Down Expand Up @@ -2219,7 +2219,7 @@
end

if gsw_cf.gsw_chks == 0
fprintf(2,'Your installation of the Gibbs SeaWater (GSW) Oceanographic Toolbox has errors !\n');
error(2,'Your installation of the Gibbs SeaWater (GSW) Oceanographic Toolbox has errors !\n');
demo = 0;
else
fprintf(1,'Well done! The gsw_check_functions confirms that the \n');
Expand Down
2 changes: 2 additions & 0 deletions run_checks.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
addpath(genpath("Toolbox/"))
gsw_check_functions

0 comments on commit ac8e71a

Please sign in to comment.