Skip to content

Commit

Permalink
240220.124931.HKT add cmake_pi.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Feb 20, 2024
1 parent 193e910 commit 8970897
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 94 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/cmake_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}', inputs.git-ref, inputs.stress-test) || '' }}


permissions:
contents: read

jobs:

cmake:
Expand Down Expand Up @@ -63,7 +66,7 @@ jobs:
shell: bash
run: |
export CC=${{ matrix.cc }}
export CFLAGS='-Wall -Wextra -Wpedantic -Werror'
CFLAGS="-Wall -Wextra -Wpedantic -Werror"
export FC=${{ matrix.fc }}
export FFLAGS='-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/cmake_nagfor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ on:
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}', inputs.git-ref, inputs.stress-test) || '' }}


permissions:
contents: read

jobs:

cmake-nagfor:
cmake:
name: CMake build with nagfor
runs-on: [self-hosted, nagfor]
continue-on-error: true
Expand All @@ -50,7 +53,7 @@ jobs:
- name: Miscellaneous setup
run: bash .github/scripts/misc_setup

- name: Conduct the test
- name: Build
run: |
source ~/local/bin/nag_licensing || echo "\n\nNAG licensing failed.\n\n"
export CFLAGS="-Wall -Wextra -Wpedantic -Werror"
Expand All @@ -63,6 +66,8 @@ jobs:
# is included in FFLAGS, then the C tests will encounter a segmentation fault, although
# the Fortran tests work correctly. According to NAG support, -C=undefined "is not compatible with calling C code via a BIND(C) interfac".
fi
cmake --version
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" .
cmake --build . --target install
cmake --build . --target tests
Expand All @@ -80,7 +85,7 @@ jobs:
check_success_timeout:
runs-on: ubuntu-latest
if: ${{ !cancelled() }}
needs: cmake-nagfor
needs: cmake
steps:
- name: Clone the GitHub actions scripts
uses: actions/checkout@v4
Expand Down
90 changes: 0 additions & 90 deletions .github/workflows/cmake_pi

This file was deleted.

91 changes: 91 additions & 0 deletions .github/workflows/cmake_pi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: CMake build on Raspberry Pi

on:
#push:
schedule:
- cron: '0 16 * * 6' # 16h Saturday
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
stress-test:
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) || '' }}


permissions:
contents: read

jobs:

cmake:
runs-on: [self-hosted, pi]
strategy:
fail-fast: false
matrix:
toolchain:
- {fc: gfortran, fflags: '-Wall -Wextra -Wpedantic -Werror -pedantic -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'}
- {fc: nvfortran, fflags: '-C -Wall -Wextra -Minform=warn -Mstandard -Mrecursive -Mbounds -Mchkstk -Mchkptr'}
- {fc: flang, fflags: '-pedantic -Weverything -Wall -Wextra'}
- {fc: armflang, fflags: '-pedantic -Weverything -Wall -Wextra'}

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
run: bash .github/scripts/misc_setup

- name: Build
shell: bash
run: |
export CC=gcc
CFLAGS="-Wall -Wextra -Wpedantic -Werror"
export FC="${{ matrix.toolchain.fc }}"
FFLAGS="${{ matrix.toolchain.fflags }}"
cmake --version
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" .
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 }}

1 comment on commit 8970897

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@check-spelling-bot Report

🔴 Please review

See the 📜action log or 📝 job summary for details.

Unrecognized words (1)

interfac

To accept these unrecognized words as correct, you could run the following commands

... in a clone of the [email protected]:libprima/prima.git repository
on the main branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/libprima/prima/actions/runs/7968610310/attempts/1'
If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Please sign in to comment.