-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from FluidNumerics/lint-workflow
Add linting workflow to execute before other workflows
- Loading branch information
Showing
190 changed files
with
10,323 additions
and
10,083 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: fprettify-lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
paths-ignore: | ||
- 'AUTHORS.md' | ||
- 'LICENSE.md' | ||
- 'README.md' | ||
pull_request: | ||
paths-ignore: | ||
- 'AUTHORS.md' | ||
- 'LICENSE.md' | ||
- 'README.md' | ||
|
||
jobs: | ||
fprettify: | ||
name: fprettify-check | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install fprettify | ||
run: | | ||
pip3 install fprettify | ||
- name: Check for formatting differences (src/) | ||
run: | | ||
if [[ $(fprettify './src/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1) ]]; then | ||
fprettify './src/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1 | ||
exit 1 | ||
else | ||
echo "src/ linting passed!" | ||
fi | ||
- name: Check for formatting differences (test/) | ||
run: | | ||
if [[ $(fprettify './test/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1) ]]; then | ||
fprettify './test/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1 | ||
exit 1 | ||
else | ||
echo "test/ linting passed!" | ||
fi | ||
- name: Check for formatting differences (example/) | ||
run: | | ||
if [[ $(fprettify './example/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1) ]]; then | ||
fprettify './example/' --config-file ./fprettify.config -d --recursive --case 1 1 1 1 | ||
exit 1 | ||
else | ||
echo "example/ linting passed!" | ||
fi | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
name: linux-gnu-cmake | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
paths-ignore: | ||
- 'AUTHORS.md' | ||
- 'LICENSE.md' | ||
- 'README.md' | ||
pull_request: | ||
paths-ignore: | ||
- 'AUTHORS.md' | ||
- 'LICENSE.md' | ||
- 'README.md' | ||
|
||
env: | ||
# Modify this variable to change the ifort compiler version - do NOT hardcode the version | ||
# anywhere else! | ||
INTEL_ONEAPI_VERSION: 2023.2.1 | ||
|
||
jobs: | ||
linux-tests: | ||
timeout-minutes: 8 | ||
if: "!contains(github.event.head_commit.message, 'skip ci')" | ||
name: ${{ matrix.os }} - ${{ matrix.fcompiler }} - ${{ matrix.build_type }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# Linux | ||
- os: ubuntu-22.04 | ||
fcompiler: gfortran-9 | ||
ccompiler: gcc-9 | ||
shell: bash | ||
build_type: coverage | ||
memcheck: true | ||
|
||
- os: ubuntu-22.04 | ||
fcompiler: gfortran-9 | ||
ccompiler: gcc-9 | ||
shell: bash | ||
build_type: debug | ||
memcheck: false | ||
|
||
- os: ubuntu-22.04 | ||
fcompiler: gfortran-10 | ||
ccompiler: gcc-10 | ||
shell: bash | ||
build_type: debug | ||
memcheck: false | ||
|
||
- os: ubuntu-22.04 | ||
fcompiler: gfortran-11 | ||
ccompiler: gcc-11 | ||
shell: bash | ||
build_type: debug | ||
memcheck: false | ||
|
||
- os: ubuntu-22.04 | ||
fcompiler: gfortran-12 | ||
ccompiler: gcc-12 | ||
shell: bash | ||
build_type: debug | ||
memcheck: false | ||
|
||
|
||
defaults: | ||
run: | ||
shell: ${{ matrix.shell }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
|
||
- name: Show version information | ||
run: | | ||
${{ matrix.fcompiler }} --version | ||
${{ matrix.ccompiler }} --version | ||
- name: Build with Cmake | ||
run: | | ||
mkdir build | ||
cd build | ||
FC=${{ matrix.fcompiler }} CC=${{ matrix.ccompiler }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../ | ||
make VERBOSE=1 | ||
- name: Initialize coverage counters | ||
if: ${{ matrix.build_type == 'coverage' }} | ||
run: | | ||
sudo apt-get update -y && sudo apt-get install lcov | ||
lcov --no-external \ | ||
--directory /home/runner/work/feq-parse \ | ||
--zerocounters | ||
- name: Run ctests | ||
run: | | ||
cd build/test | ||
ctest || ctest --rerun-failed --output-on-failure | ||
- name: Create coverage report | ||
if: ${{ matrix.build_type == 'coverage' }} | ||
run: | | ||
lcov --no-external \ | ||
--capture \ | ||
--directory /home/runner/work/feq-parse \ | ||
--exclude '*/test/*' \ | ||
--output-file /home/runner/work/lcov.info | ||
- name: codecov | ||
if: ${{ matrix.build_type == 'coverage' }} | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
files: /home/runner/work/lcov.info | ||
flags: ctests | ||
|
||
- name: Run memory checks with Valgrind (only Linux and GNU compilers) | ||
if: ${{ matrix.memcheck }} | ||
run: | | ||
sudo apt-get install -y valgrind | ||
for f in $(find ./build/test/ -executable -type f) | ||
do | ||
echo $f | ||
valgrind --undef-value-errors=no --error-exitcode=1 -s $f -A | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: linux-gnu-fpm | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
paths-ignore: | ||
- 'AUTHORS.md' | ||
- 'LICENSE.md' | ||
- 'README.md' | ||
pull_request: | ||
paths-ignore: | ||
- 'AUTHORS.md' | ||
- 'LICENSE.md' | ||
- 'README.md' | ||
|
||
env: | ||
# Modify this variable to change the ifort compiler version - do NOT hardcode the version | ||
# anywhere else! | ||
INTEL_ONEAPI_VERSION: 2023.2.1 | ||
|
||
jobs: | ||
linux-tests: | ||
timeout-minutes: 8 | ||
if: "!contains(github.event.head_commit.message, 'skip ci')" | ||
name: ${{ matrix.os }} - ${{ matrix.fcompiler }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# Linux | ||
- os: ubuntu-22.04 | ||
fcompiler: gfortran-9 | ||
ccompiler: gcc-9 | ||
shell: bash | ||
|
||
- os: ubuntu-22.04 | ||
fcompiler: gfortran-10 | ||
ccompiler: gcc-10 | ||
shell: bash | ||
|
||
- os: ubuntu-22.04 | ||
fcompiler: gfortran-11 | ||
ccompiler: gcc-11 | ||
shell: bash | ||
|
||
- os: ubuntu-22.04 | ||
fcompiler: gfortran-12 | ||
ccompiler: gcc-12 | ||
shell: bash | ||
|
||
|
||
defaults: | ||
run: | ||
shell: ${{ matrix.shell }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
|
||
- name: Show version information | ||
run: | | ||
${{ matrix.fcompiler }} --version | ||
${{ matrix.ccompiler }} --version | ||
- name: fpm tests | ||
run: | | ||
wget https://github.com/fortran-lang/fpm/releases/download/v0.9.0/fpm-0.9.0-linux-x86_64 | ||
chmod +x ./fpm-0.9.0-linux-x86_64 && mv ./fpm-0.9.0-linux-x86_64 fpm | ||
./fpm install --compiler ${{ matrix.fcompiler }} --c-compiler ${{ matrix.ccompiler }} | ||
./fpm test --compiler ${{ matrix.fcompiler }} --c-compiler ${{ matrix.ccompiler }} | ||
./fpm run --compiler ${{ matrix.fcompiler }} --c-compiler ${{ matrix.ccompiler }} --example "*" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.