Skip to content

Commit

Permalink
240120.130411.HKT add cmake_mac.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Jan 20, 2024
1 parent be96f5d commit 4b51864
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 4 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/cmake_mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CMake build, 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 18 * * *'
# Trigger the workflow manually
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
stress:
description: Stress Test (Optional, true or false)
required: false

# Show the git ref in the workflow name if it is invoked manually.
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}', inputs.git-ref, inputs.stress-test) || '' }}


jobs:

cmake:
runs-on: [self-hosted, macOS, ARM64]
continue-on-error: true
strategy:
fail-fast: false
matrix:
cc: [gcc, clang]
fc: [gfortran, nagfor]


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
fetch-depth: 0
fetch-tags: true
- 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
fetch-depth: 0
fetch-tags: true

- name: Miscellaneous setup
run: bash .github/scripts/misc_setup

- name: Build
shell: bash
run: |
export CC=${{ matrix.cc }}
export CMAKE_C_FLAGS='-Wall -Wextra -Wpedantic -Werror'
export FC=${{ matrix.fc }}
if [[ "$FC"=="nagfor" ]] ; then
source ~/local/bin/nag_licensing || echo "\n\nNAG licensing failed.\n\n"
export CMAKE_Fortran_FLAGS='-fpp -nan -ieee=stop -recursive -info -gline -u -C -C=alias -C=dangling -C=intovf -C=undefined -kind=unique -Warn=constant_coindexing -Warn=subnormal'
else
export CMAKE_Fortran_FLAGS='-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'
fi
cmake --version
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH .
cmake --build . --target install
cmake --build . --target tests
ctest --output-on-failure -V -E stress
- name: Stress test
if: ${{ github.event_name == 'schedule' || github.event.inputs.stress-test == 'true' }}
shell: bash
run: |
ctest --output-on-failure -V -R stress
# 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: cmake
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_big_test ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }}
2 changes: 1 addition & 1 deletion .github/workflows/cmake_nagfor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CMake build / nagfor
name: CMake build, nagfor

on:
# Trigger the workflow on push or pull request
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/test_matlab_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
test:
name: Test MATLAB
runs-on: [self-hosted, macOS, ARM64]
continue-on-error: true
strategy:
fail-fast: false

Expand Down Expand Up @@ -68,3 +69,20 @@ jobs:

- 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 "cd matlab/tests; testprima_ex();"

# 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_big_test ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,17 @@ to distribute this large amount of tests to multiple Team accounts as follows.
- [Tests](https://github.com/libprima/prima/actions) at [libprima/prima](https://github.com/libprima/prima)

- [![CMake build](https://github.com/libprima/prima/actions/workflows/cmake.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/cmake.yml)
- [![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)
- [![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)
- [![CMake build, macOS ARM64](https://github.com/libprima/prima/actions/workflows/cmake_mac.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/cmake_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)
- [![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)

- <a name="verification"></a> [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)
Expand Down

0 comments on commit 4b51864

Please sign in to comment.