Skip to content

Commit

Permalink
240120.000312.HKT add test_gfortran_mac
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Jan 19, 2024
1 parent 8d9f034 commit b17e6e3
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 1 deletion.
95 changes: 95 additions & 0 deletions .github/workflows/test_gfortran_mac_big.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Test gfortran on macOS ARM64, big

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/5 * *'
# Trigger the workflow manually
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
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}', inputs.git-ref) || '' }}


jobs:

test:
name: Run gfortran tests
runs-on: [self-hosted, macOs, ARM64]
continue-on-error: true
strategy:
fail-fast: false
matrix:
ikind: [i2, i8]
solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa]
fflags: [-O1, -O2, -O3, -g, -fast]
testdim: [big]

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
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
submodules: recursive

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

- name: Conduct the test
shell: bash
run: |
#cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -g && bash ./mlint -g
export FFLAGS=${{ matrix.fflags }}
export TESTDIM=${{ matrix.testdim }}
cd "$ROOT_DIR"/fortran/tests
make gtest_${{ matrix.ikind }}_r4_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r4_d1_tst.${{ matrix.solver }}
make gtest_${{ matrix.ikind }}_r8_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r8_d1_tst.${{ matrix.solver }}
export FS=18
cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }}
export EXAMPLE_NUM=1 && make clean && make gtest
export EXAMPLE_NUM=2 && make clean && make gtest
# - name: Store artifacts
# uses: actions/[email protected]
# if: always() # Always run even if the workflow is canceled manually or due to overtime.
# # Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`.
# # In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent.
# with:
# path: ${{ env.TEST_DIR }}/prima/fortran/tests/test.${{ matrix.solver }}/log/*.log

- name: Remove the test data
if: always() # Always run even if the workflow is canceled manually or due to overtime.
run: rm -rf ${{ env.TEST_DIR }}

# 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 }}
78 changes: 78 additions & 0 deletions .github/workflows/test_gfortran_mac_small.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Test gfortran on macOS ARM64, small

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/5 * *'
# Trigger the workflow manually
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
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}', inputs.git-ref) || '' }}


jobs:

test:
name: Run gfortran tests
runs-on: [self-hosted, macOS, ARM64]
strategy:
fail-fast: false
matrix:
ikind: [i2, i8]
solver: [newuoa, cobyla, lincoa, bobyqa, uobyqa]
fflags: [-O1, -O2, -O3, -g, -fast]
testdim: [small]

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
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
submodules: recursive

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

- name: Conduct the test
shell: bash
run: |
#cd "$ROOT_DIR"/fortran/${{ matrix.solver }} && bash ./flint -g && bash ./mlint -g # On Raspberry Pi, perform lintering only for small tests of gfortran
export FFLAGS=${{ matrix.fflags }}
export TESTDIM=${{ matrix.testdim }}
cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_r4_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r4_d1_tst.${{ matrix.solver }}
cd "$ROOT_DIR"/fortran/tests && make gtest_${{ matrix.ikind }}_r8_d1_tst_c.${{ matrix.solver }} && make gtest_${{ matrix.ikind }}_r8_d1_tst.${{ matrix.solver }}
export FS=18
cd "$ROOT_DIR"/fortran/examples/${{ matrix.solver }}
export EXAMPLE_NUM=1 && make clean && make gtest
export EXAMPLE_NUM=2 && make clean && make gtest
- name: Store artifacts
uses: actions/[email protected]
if: always() # Always run even if the workflow is canceled manually or due to overtime.
# Note that `$TEST_DIR` does not work on Windows, where its equivalent is `$env:TEST_DIR`.
# In the following, we enquire `$TEST_DIR` by using the `env` context, which is platform independent.
with:
name: ${{ matrix.solver }}-${{ matrix.ikind }}-${{ matrix.fflags }}-${{ matrix.testdim }}
path: ${{ env.TEST_DIR }}/prima/fortran/tests/test.${{ matrix.solver }}/log/*.log

- name: Remove the test data
if: always() # Always run even if the workflow is canceled manually or due to overtime.
shell: bash # Important; otherwise, `rm -rf` will not work on Windows.
run: rm -rf ${{ env.TEST_DIR }}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ to distribute this large amount of tests to multiple Team accounts as follows.
- [![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_matlab_nagfor.yml/badge.svg)](https://github.com/libprima/prima/actions/workflows/test_matlab_nagfor.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)

- <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 b17e6e3

Please sign in to comment.