From be96f5d1bebbd88a9c1484fe4f2a232f2ee31134 Mon Sep 17 00:00:00 2001 From: zaikunzhang Date: Sat, 20 Jan 2024 00:38:03 +0800 Subject: [PATCH] 240120.003803.HKT add stress/parallel/recursive matlab test to macos arm64 --- .../workflows/parallel_test_matlab_mac.yml | 68 +++++++++++++++++++ .../workflows/recursive_test_matlab_mac.yml | 68 +++++++++++++++++++ .github/workflows/stress_test_matlab_mac.yml | 68 +++++++++++++++++++ .github/workflows/test_matlab_mac.yml | 2 +- .github/workflows/test_nagfor_mac.yml | 2 +- README.md | 5 +- 6 files changed, 210 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/parallel_test_matlab_mac.yml create mode 100644 .github/workflows/recursive_test_matlab_mac.yml create mode 100644 .github/workflows/stress_test_matlab_mac.yml diff --git a/.github/workflows/parallel_test_matlab_mac.yml b/.github/workflows/parallel_test_matlab_mac.yml new file mode 100644 index 0000000000..989d7c4bd8 --- /dev/null +++ b/.github/workflows/parallel_test_matlab_mac.yml @@ -0,0 +1,68 @@ +name: Parallel test, MATLAB, macOS ARM64 + +on: + # Trigger the workflow on push or pull request + #push: + #pull_request: # DANGEROUS! MUST be disabled for self-hosted runners! + # Trigger the workflow by cron. The default time zone of GitHub Actions is UTC. + schedule: + - cron: '0 16 2-31/3 * *' + # Trigger the workflow manually + workflow_dispatch: + +jobs: + test: + name: Parallel test of PRIMA + runs-on: [self-hosted, macOS, ARM64] + continue-on-error: true + strategy: + fail-fast: false + matrix: + solver: [uobyqa, newuoa, bobyqa, lincoa, cobyla] + + steps: + - name: Clone Repository (Latest) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref == '' + with: + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 231227, checkout with ssh fails frequently on Windows runners. + submodules: recursive + - name: Clone Repository (Custom Ref) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref != '' + with: + ref: ${{ github.event.inputs.git-ref }} + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 231227, checkout with ssh fails frequently on Windows runners. + submodules: recursive + + - name: Conduct the test # We do not use matlab-actions/run-command, which is not supported on macOS ARM64 as of 20240119 + run: /Applications/MATLAB_R2023b.app/bin/matlab -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); parallel('${{ matrix.solver }}'); copy_crash_dump_files(root_dir);" + + - name: Store artifacts + uses: actions/upload-artifact@v4.2.0 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + name: ${{ matrix.solver }} + path: | + matlab_crash_dump* + + + + # The following job check whether the tests were successful or cancelled due to timeout. + # N.B.: Remember to specify `continue-on-error: true` for the job of the tests. + check_success_timeout: + runs-on: ubuntu-latest + if: ${{ !cancelled() }} + needs: test + steps: + - name: Clone the GitHub actions scripts + uses: actions/checkout@v4 + with: + repository: equipez/github_actions_scripts + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + path: scripts + + - name: Check whether the tests were successful or cancelled due to timeout + run: bash scripts/check_success_timeout ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/recursive_test_matlab_mac.yml b/.github/workflows/recursive_test_matlab_mac.yml new file mode 100644 index 0000000000..0c719ab3c3 --- /dev/null +++ b/.github/workflows/recursive_test_matlab_mac.yml @@ -0,0 +1,68 @@ +name: Recursive test, MATLAB, macOS ARM64 + +on: + # Trigger the workflow on push or pull request + #push: + #pull_request: # DANGEROUS! MUST be disabled for self-hosted runners! + # Trigger the workflow by cron. The default time zone of GitHub Actions is UTC. + schedule: + - cron: '0 16 1-31/3 * *' + # Trigger the workflow manually + workflow_dispatch: + +jobs: + test: + name: Recursive test of PRIMA + runs-on: [self-hosted, macOS, ARM64] + continue-on-error: true + strategy: + fail-fast: false + matrix: + solver: [uobyqa, newuoa, bobyqa, lincoa, cobyla] + + steps: + - name: Clone Repository (Latest) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref == '' + with: + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 231227, checkout with ssh fails frequently on Windows runners. + submodules: recursive + - name: Clone Repository (Custom Ref) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref != '' + with: + ref: ${{ github.event.inputs.git-ref }} + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 231227, checkout with ssh fails frequently on Windows runners. + submodules: recursive + + - name: Conduct the test # We do not use matlab-actions/run-command, which is not supported on macOS ARM64 as of 20240119 + run: /Applications/MATLAB_R2023b.app/bin/matlab -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); recursive('${{ matrix.solver }}'); copy_crash_dump_files(root_dir);" + + - name: Store artifacts + uses: actions/upload-artifact@v4.2.0 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + name: ${{ matrix.solver }} + path: | + matlab_crash_dump* + + + + # The following job check whether the tests were successful or cancelled due to timeout. + # N.B.: Remember to specify `continue-on-error: true` for the job of the tests. + check_success_timeout: + runs-on: ubuntu-latest + if: ${{ !cancelled() }} + needs: test + steps: + - name: Clone the GitHub actions scripts + uses: actions/checkout@v4 + with: + repository: equipez/github_actions_scripts + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + path: scripts + + - name: Check whether the tests were successful or cancelled due to timeout + run: bash scripts/check_success_timeout ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/stress_test_matlab_mac.yml b/.github/workflows/stress_test_matlab_mac.yml new file mode 100644 index 0000000000..4cfe204e27 --- /dev/null +++ b/.github/workflows/stress_test_matlab_mac.yml @@ -0,0 +1,68 @@ +name: Stress test, MATLAB, macOS ARM64 + +on: + # Trigger the workflow on push or pull request + #push: + #pull_request: # DANGEROUS! MUST be disabled for self-hosted runners! + # Trigger the workflow by cron. The default time zone of GitHub Actions is UTC. + schedule: + - cron: '0 16 3-31/3 * *' + # Trigger the workflow manually + workflow_dispatch: + +jobs: + test: + name: Stress test of PRIMA + runs-on: [self-hosted, macOS, ARM64] + continue-on-error: true + strategy: + fail-fast: false + matrix: + solver: [uobyqa, newuoa, bobyqa, lincoa, cobyla] + + steps: + - name: Clone Repository (Latest) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref == '' + with: + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 231227, checkout with ssh fails frequently on Windows runners. + submodules: recursive + - name: Clone Repository (Custom Ref) + uses: actions/checkout@v4 + if: github.event.inputs.git-ref != '' + with: + ref: ${{ github.event.inputs.git-ref }} + # ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + # As of 231227, checkout with ssh fails frequently on Windows runners. + submodules: recursive + + - name: Conduct the test # We do not use matlab-actions/run-command, which is not supported on macOS ARM64 as of 20240119 + run: /Applications/MATLAB_R2023b.app/bin/matlab -batch "ver; root_dir = pwd(); cd(fullfile(root_dir, 'matlab/tests')); stress('${{ matrix.solver }}'); copy_crash_dump_files(root_dir);" + + - name: Store artifacts + uses: actions/upload-artifact@v4.2.0 + if: always() # Always run even if the workflow is canceled manually or due to overtime. + with: + name: ${{ matrix.solver }} + path: | + matlab_crash_dump* + + + + # The following job check whether the tests were successful or cancelled due to timeout. + # N.B.: Remember to specify `continue-on-error: true` for the job of the tests. + check_success_timeout: + runs-on: ubuntu-latest + if: ${{ !cancelled() }} + needs: test + steps: + - name: Clone the GitHub actions scripts + uses: actions/checkout@v4 + with: + repository: equipez/github_actions_scripts + ssh-key: ${{ secrets.SSH_PRIVATE_KEY_ACT }} # This forces checkout to use SSH, not HTTPS + path: scripts + + - name: Check whether the tests were successful or cancelled due to timeout + run: bash scripts/check_success_timeout ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }} diff --git a/.github/workflows/test_matlab_mac.yml b/.github/workflows/test_matlab_mac.yml index ee8c15449f..9ebbffe64d 100644 --- a/.github/workflows/test_matlab_mac.yml +++ b/.github/workflows/test_matlab_mac.yml @@ -6,7 +6,7 @@ on: #pull_request: # DANGEROUS! MUST be disabled for self-hosted runners! # Trigger the workflow by cron. The default time zone of GitHub Actions is UTC. schedule: - - cron: '0 1 * * *' + - cron: '0 0 * * *' # Trigger the workflow manually workflow_dispatch: inputs: diff --git a/.github/workflows/test_nagfor_mac.yml b/.github/workflows/test_nagfor_mac.yml index 71e2720814..453683d586 100644 --- a/.github/workflows/test_nagfor_mac.yml +++ b/.github/workflows/test_nagfor_mac.yml @@ -6,7 +6,7 @@ on: #pull_request: # DANGEROUS! MUST be disabled for self-hosted runners! # Trigger the workflow by cron. The default time zone of GitHub Actions is UTC. schedule: - - cron: '0 19 * * *' + - cron: '0 8 * * *' # Trigger the workflow manually workflow_dispatch: inputs: diff --git a/README.md b/README.md index fabb0b84ad..b70ccc2ee9 100644 --- a/README.md +++ b/README.md @@ -134,10 +134,13 @@ to distribute this large amount of tests to multiple Team accounts as follows. - [![CMake build / nagfor](https://github.com/libprima/prima/actions/workflows/cmake_nagfor.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/cmake_nagfor.yml) - [![Test nagfor](https://github.com/libprima/prima/actions/workflows/test_nagfor.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/test_nagfor.yml) - [![Lint the Fortran code and the MEX gateways with nagfor](https://github.com/libprima/prima/actions/workflows/lint_nagfor.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/lint_nagfor.yml) - - [![Test matlab, macOS ARM64](https://github.com/libprima/prima/actions/workflows/test_matlab_mac.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/test_matlab_mac.yml) - [![Test nagfor, macOS ARM64](https://github.com/libprima/prima/actions/workflows/test_nagfor_mac.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/test_nagfor_mac.yml) - [![Test gfortran, macOS ARM64, small](https://github.com/libprima/prima/actions/workflows/test_gfortran_mac_small.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/test_gfortran_mac_small.yml) - [![Test gfortran, macOS ARM64, big](https://github.com/libprima/prima/actions/workflows/test_gfortran_mac_big.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/test_gfortran_mac_big.yml) + - [![Test matlab, macOS ARM64](https://github.com/libprima/prima/actions/workflows/test_matlab_mac.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/test_matlab_mac.yml) + - [![Stress test, matlab, macOS ARM64](https://github.com/libprima/prima/actions/workflows/stress_test_matlab_mac.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/stress_test_matlab_mac.yml) + - [![Parallel test, matlab, macOS ARM64](https://github.com/libprima/prima/actions/workflows/parallel_test_matlab_mac.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/parallel_test_matlab_mac.yml) + - [![Recursive test, matlab, macOS ARM64](https://github.com/libprima/prima/actions/workflows/recursive_test_matlab_mac.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/recursive_test_matlab_mac.yml) - [Tests](https://github.com/libsprima/prima/actions) at [libsprima/prima](https://github.com/libsprima/prima) - [![Verification, small](https://github.com/libsprima/prima/actions/workflows/verify_small.yml/badge.svg)](https://github.com/libsprima/prima/actions/workflows/verify_small.yml)