From 52823360dc9693be3e38c7d7d7c4910fd7e6eeac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Aradi?= Date: Fri, 23 Feb 2024 20:49:23 +0100 Subject: [PATCH] Extend CI with fpm build (#2) --- .github/workflows/ci.yml | 22 +++++++++++++++++++--- test/export/CMakeLists.txt | 5 ++--- test/export/app/CMakeLists.txt | 2 ++ test/export/{ => app}/testapp.f90 | 0 test/export/fpm.toml | 27 +++++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 test/export/app/CMakeLists.txt rename test/export/{ => app}/testapp.f90 (100%) create mode 100644 test/export/fpm.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 636cdc3..4504ed2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,10 @@ env: jobs: - cmake_build: + # + # Builds and tests with CMake + # + ubuntu-ifx: runs-on: ubuntu-latest @@ -29,7 +32,9 @@ jobs: components: ifx - name: Set compiler environment - run: echo "FC=ifx" >> ${GITHUB_ENV} + run: | + echo "FC=ifx" >> ${GITHUB_ENV} + echo "FPM_FC=ifx" >> ${GITHUB_ENV} - name: Setup CMake uses: jwlawson/actions-setup-cmake@v1.14 @@ -58,6 +63,17 @@ jobs: export PKG_CONFIG_PATH="${INSTALL_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}" cflags="$(pkg-config --cflags fortuno)" lflags="$(pkg-config --libs fortuno)" - ifx ${cflags} ${lflags} -o testapp test/export/testapp.f90 + ifx ${cflags} ${lflags} -o testapp test/export/app/testapp.f90 ./testapp rm ./testapp + + - name: Setup fpm + uses: fortran-lang/setup-fpm@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Test fpm export + run: | + source /opt/intel/oneapi/setvars.sh + cd test/export + fpm run testapp diff --git a/test/export/CMakeLists.txt b/test/export/CMakeLists.txt index 37b6c06..6eb6cbf 100644 --- a/test/export/CMakeLists.txt +++ b/test/export/CMakeLists.txt @@ -8,7 +8,6 @@ project( ) find_package(Fortuno REQUIRED) -message(STATUS "Fortuno unit testing system: ${Fortuno_VERSION}") -add_executable(testapp testapp.f90) -target_link_libraries(testapp PRIVATE Fortuno::Fortuno) +add_executable(testapp) +add_subdirectory(app) diff --git a/test/export/app/CMakeLists.txt b/test/export/app/CMakeLists.txt new file mode 100644 index 0000000..f561445 --- /dev/null +++ b/test/export/app/CMakeLists.txt @@ -0,0 +1,2 @@ +target_sources(testapp PRIVATE testapp.f90) +target_link_libraries(testapp PRIVATE Fortuno::Fortuno) diff --git a/test/export/testapp.f90 b/test/export/app/testapp.f90 similarity index 100% rename from test/export/testapp.f90 rename to test/export/app/testapp.f90 diff --git a/test/export/fpm.toml b/test/export/fpm.toml new file mode 100644 index 0000000..5836eef --- /dev/null +++ b/test/export/fpm.toml @@ -0,0 +1,27 @@ +name = "fortuno-test-export" +version = "0.0.0" +license = "BSD-2-Clause-Patent" +author = "Fortuno authors" +maintainer = "aradi@uni-bremen.de" +copyright = "Copyright 2024, Fortuno authors" + +[build] +auto-executables = false +auto-tests = false +auto-examples = false +module-naming = false + +[install] +library = false + +[fortran] +implicit-typing = false +implicit-external = false +source-form = "free" + +[dependencies] +fortuno = { path = "../../" } + +[[executable]] +name = "testapp" +main = "testapp.f90" \ No newline at end of file