Skip to content

Commit

Permalink
Extend CI with fpm build (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
aradi authored Feb 23, 2024
1 parent 2e7439c commit 5282336
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ env:

jobs:

cmake_build:
#
# Builds and tests with CMake
#
ubuntu-ifx:

runs-on: ubuntu-latest

Expand All @@ -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
Expand Down Expand Up @@ -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
5 changes: 2 additions & 3 deletions test/export/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions test/export/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target_sources(testapp PRIVATE testapp.f90)
target_link_libraries(testapp PRIVATE Fortuno::Fortuno)
File renamed without changes.
27 changes: 27 additions & 0 deletions test/export/fpm.toml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 5282336

Please sign in to comment.