Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[code skip]
  • Loading branch information
prudhomm committed Sep 12, 2024
2 parents e6762d6 + 730c828 commit cc90b31
Show file tree
Hide file tree
Showing 29 changed files with 1,816 additions and 378 deletions.
161 changes: 123 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,85 @@
name: CI

on:
on:
push:
branches:
branches:
- '**' # Push events on all branches
paths-ignore:
- '.github/workflows/init.yml'
- 'docs/**'
- 'package*.json'
- 'site.yml'
- 'generate-jupyter.sh'
- 'netlify*'
- '.github/workflows/docs.yml'
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 including semver

jobs:

build_wheel:
runs-on: self-ubuntu-22.04
name: Build wheel
if: "!contains(github.event.head_commit.message, 'wheel skip')"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
submodules: 'recursive'
-
name: Create Virtual Environment
run: |
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
npm install
npx downdoc -o README.md README.adoc
-
name: Compile
run: |
pip3 wheel --no-deps --wheel-dir dist .
env:
CXX: clang++

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
# Artifact name
name: wheel-artifacts
# Directory containing files to upload
path: dist/*.whl
docs:
runs-on: self-ubuntu-24.04
name: Build Antora Site
needs: build_wheel
if: "!contains(github.event.head_commit.message, 'docs skip')"
steps:
- uses: actions/checkout@v4
with:
lfs: true
submodules: 'recursive'
- name: Install credentials
run: echo https://$GITHUB_OAUTH:@github.com > $HOME/.git-credentials
env:
GITHUB_OAUTH: ${{ secrets.CR_PAT_WORKFLOW }}
- name: Install NPM dependencies
run: npm install
- name: Download
uses: actions/download-artifact@v3
with:
# Artifact name
name: wheel-artifacts
path: dist/
- name: Install Python dependencies
run: |
python -m venv --system-site-packages .venv
source .venv/bin/activate
pip3 install -r requirements.txt
pip3 install dist/*.whl
tree .venv
- name: Build Antora Site
run: |
source .venv/bin/activate
npm run antora
- name: Deploy
if: ${{ github.ref_name == 'master' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: public # The folder the action should deploy.
build_code:
runs-on: self-ubuntu-24.04
name: Build, Install, Package code
Expand All @@ -26,64 +89,53 @@ jobs:
uses: actions/checkout@v4
with:
lfs: true
recursive: true
-
name: Build
submodules: 'recursive'
-
name: Build
run: |
cmake --preset default
cmake --build --preset default
-
name: Check
-
name: Check
run: |
ctest --preset default
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
-
-
name: Package
run: |
cmake --build --preset default -t package
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
# Artifact name
name: course-rom-artifacts
name: feelpp-project-artifacts
# Directory containing files to upload
path: build/default/assets/course-rom-*
- name: Release
if: startsWith(github.ref ,'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: build/default/assets/course-rom-*
draft: false
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')}}
name: Release ${{ github.ref_name }}
generate_release_notes: true
tag_name: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
path: build/default/assets/feelpp-project-*
deliver:
runs-on: self-ubuntu-24.04
needs: build_code
name: Build docker, tag and push

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: true
submodules: 'recursive'
- name: Download
- name: Download
uses: actions/download-artifact@v3
with:
# Artifact name
name: course-rom-artifacts
name: feelpp-project-artifacts
path: artifacts/
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/feelpp/course-rom
ghcr.io/feelpp/feelpp-project
tags: |
type=ref,event=branch
type=ref,event=pr
Expand All @@ -95,20 +147,53 @@ jobs:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
-
-
name: Build container image
uses: docker/build-push-action@v5
with:
with:
context: artifacts
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ./Dockerfile

release:
runs-on: self-ubuntu-22.04
name: Release
needs: [build_wheel, build_code]
if: startsWith(github.ref ,'refs/tags/v')
steps:
- uses: actions/checkout@v4
with:
lfs: true
submodules: 'recursive'
- name: Download Deb Packages
uses: actions/download-artifact@v3
with:
# Artifact name
name: feelpp-project-artifacts
path: artifacts/
- name: Download Wheel Packages
uses: actions/download-artifact@v3
with:
# Artifact name
name: wheel-artifacts
path: dist/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/*.deb
dist/*.whl
draft: false
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')}}
name: Release ${{ github.ref_name }}
generate_release_notes: true
tag_name: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
49 changes: 0 additions & 49 deletions .github/workflows/docs.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/init.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ jupyter/
auto-save-list
tramp
.\#*
.DS_Store
.DS_Store
.venv*
dist/
feelppdb
README.md
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
#
#
cmake_minimum_required(VERSION 3.21.0)
project(course-rom VERSION 2.0.2)

project(
course-rom
VERSION 1.0.0 )

set(EXTRA_VERSION "")
set(PROJECT_SHORTNAME "cr")

Expand All @@ -33,6 +37,9 @@ if (POLICY CMP0077)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
endif()

find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)

find_package(Feel++ COMPONENTS Toolboxes PATHS ${FEELPP_DIR}/share/feelpp/feel/cmake/modules $ENV{FEELPP_DIR}/share/feelpp/feel/cmake/modules /usr/share/feelpp/feel/cmake/modules /usr/local/share/feelpp/feel/cmake/modules )
if(NOT FEELPP_FOUND)
message(FATAL_ERROR "Feel++ was not found on your system. Make sure to install it and specify the FEELPP_DIR to reference the installation directory.")
Expand All @@ -49,7 +56,7 @@ endif()


add_subdirectory( src )
add_subdirectory( docs )
#add_subdirectory( docs )

# extra ignored files
list(APPEND CPACK_SOURCE_IGNORE_FILES
Expand All @@ -63,7 +70,7 @@ set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSI
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}${EXTRA_VERSION}")
SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}-${CMAKE_SYSTEM_NAME}")
set(CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}/assets")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cemosis course-rom template application")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Cemosis feelpp-project template application")
set(CPACK_PACKAGE_DESCRIPTION "Cemosis provides a Feel++ template application.")
set(CPACK_PACKAGE_VENDOR "Cemosis")
set(CPACK_PACKAGE_CONTACT "Christophe Prud'homme <[email protected]>")
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ asciidoc:
python: Python
cpp: C++
dynamic-blocks@: ''
page-toclevels: 3
page-toclevels: 3@
ext:
collector:
- run:
Expand Down
Loading

0 comments on commit cc90b31

Please sign in to comment.