diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9f596d..2f1a3c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,9 @@ # This is a basic workflow to help you get started with MATLAB Actions -name: MATLAB Build +name: CI # Controls when the action will run. on: - # Triggers the workflow on push or pull request events, but only for the main branch - push: - branches: [ main ] + # Triggers the workflow on pull request events, but only for the main branch pull_request: branches: [ main ] @@ -13,8 +11,7 @@ on: workflow_dispatch: env: - PRODUCT_LIST: MATLAB MATLAB_Test SimBiology Statistics_and_Machine_Learning_Toolbox MATLAB_Compiler - MLM_LICENSE_TOKEN: ${{ secrets.MYTOKEN }} + PRODUCT_LIST: MATLAB MATLAB_Test SimBiology Statistics_and_Machine_Learning_Toolbox # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -25,7 +22,7 @@ permissions: # Only allow one build of this type to run at a time # Ensure results publishing completes without being interrupted/overwritten concurrency: - group: "test and publish results" + group: "test" cancel-in-progress: false jobs: @@ -53,74 +50,3 @@ jobs: uses: matlab-actions/run-build@v2 with: tasks: test - - build: - - # Set up URLs for GitHub Pages report - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - # The type of runner that the job will run on - runs-on: windows-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - # Check out your repository - - uses: actions/checkout@v5 - - # Set up MATLAB on a GitHub-hosted runner - - name: Setup MATLAB - uses: matlab-actions/setup-matlab@v2 - with: - products: ${{ env.PRODUCT_LIST }} - cache: true - - # Run the MATLAB build tool to build and test your code - - name: Run buildtool - uses: matlab-actions/run-build@v2 - with: - tasks: compile - - # Configure GitHub Pages to accept your artifact uploads - - name: Setup Pages - if: always() - uses: actions/configure-pages@v5 - - # Upload testing and code coverage reports to your repository - - name: Upload pages - if: always() - uses: actions/upload-pages-artifact@v4 - with: - path: results # Upload results - - # Upload compiled CTF file to deploy Web App - - name: Upload CTF file - uses: actions/upload-pages-artifact@v4 - with: - name: WebApp_CTF - path: WebAppArchive/*.ctf - - # Publish reports to GitHub Pages so they can be viewed in a browser - - name: Deploy to GitHub Pages - id: deployment - if: always() - uses: actions/deploy-pages@v4 - - - # ==================================== # - # Alternate ways to run commands in CI # - # ==================================== # - - ## Runs your tests using `runtests` command - #- name: Run all tests - # uses: matlab-actions/run-tests@v2 - # with: - # source-folder: code - - ## Executes custom MATLAB scripts, functions, or statements - #- name: Run custom testing procedure - # uses: matlab-actions/run-command@v2 - # with: - # command: disp('Running my custom testing procedure!'); addpath('code'); results = runtests('IncludeSubfolders', true); assertSuccess(results); diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..35a9c3c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,99 @@ +# This is a basic workflow to help you get started with MATLAB Actions +name: MATLAB Build + +# Controls when the action will run. +on: + # Triggers the workflow on push events, but only for the main branch + push: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + PRODUCT_LIST: MATLAB MATLAB_Test SimBiology Statistics_and_Machine_Learning_Toolbox + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Only allow one build of this type to run at a time +# Ensure results publishing completes without being interrupted/overwritten +concurrency: + group: "test and publish results" + cancel-in-progress: false + +jobs: + + build: + + # Set up URLs for GitHub Pages report + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # The type of runner that the job will run on + runs-on: windows-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + + # Check out your repository + - uses: actions/checkout@v5 + + # Set up MATLAB on a GitHub-hosted runner + - name: Setup MATLAB + uses: matlab-actions/setup-matlab@v2 + with: + products: ${{ env.PRODUCT_LIST }} + cache: true + + # Run the MATLAB build tool to build and test your code + - name: Run buildtool + uses: matlab-actions/run-build@v2 + with: + tasks: test + + # Configure GitHub Pages to accept your artifact uploads + - name: Setup Pages + if: always() + uses: actions/configure-pages@v5 + + # Upload testing and code coverage reports to your repository + - name: Upload pages + if: always() + uses: actions/upload-pages-artifact@v4 + with: + path: results # Upload results + + # Upload compiled CTF file to deploy Web App + - name: Upload CTF file + uses: actions/upload-pages-artifact@v4 + with: + name: WebApp_CTF + path: WebAppArchive/*.ctf + + # Publish reports to GitHub Pages so they can be viewed in a browser + - name: Deploy to GitHub Pages + id: deployment + if: always() + uses: actions/deploy-pages@v4 + + + # ==================================== # + # Alternate ways to run commands in CI # + # ==================================== # + + ## Runs your tests using `runtests` command + #- name: Run all tests + # uses: matlab-actions/run-tests@v2 + # with: + # source-folder: code + + ## Executes custom MATLAB scripts, functions, or statements + #- name: Run custom testing procedure + # uses: matlab-actions/run-command@v2 + # with: + # command: disp('Running my custom testing procedure!'); addpath('code'); results = runtests('IncludeSubfolders', true); assertSuccess(results);