Skip to content

Commit

Permalink
automated deployment to GitHub Pages: f28200a
Browse files Browse the repository at this point in the history
  • Loading branch information
prashjha committed Jun 30, 2024
1 parent df5038c commit d8de0cb
Show file tree
Hide file tree
Showing 5,489 changed files with 737,536 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
52 changes: 52 additions & 0 deletions .circleci/Docker/Dockerfile-focal
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -------------------------------------------
# Copyright (c) 2021 - 2024 Prashant K. Jha
# -------------------------------------------
# PeriDEM https://github.com/prashjha/PeriDEM
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE)

# base ubuntu image with essentials and vtk
FROM prashjha/peridem-base-focal:latest

# Set metadata
LABEL maintainer="Prashant K. Jha <pjha.sci@gmail.com>"
LABEL description="PeriDEM docker image"

## build command
## docker build -t prashjha/peridem-focal:latest -f ./Dockerfile-focal . 2>&1 | tee log-peridem-focal.txt

# -----------------------
# setup user (for mpi tests)
# username - user
# password - password
# add only if the user does not exist
# -----------------------
RUN if id user >/dev/null 2>&1; then echo "User 'user' already exists"; else echo "User 'user' does not exist so creating user 'user'" && useradd -m user && yes password | passwd user && usermod -s /bin/bash user; fi

# change user
USER user
WORKDIR /home/user

# -----------------------
# setup git pull method
# -----------------------
RUN git config --global url."https://github.com/".insteadOf git@github.com: && \
git config --global url."https://".insteadOf git://

# -----------------------
# build peridem
# -----------------------
RUN git clone https://github.com/prashjha/PeriDEM.git &&\
cd PeriDEM && \
mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release \
-DEnable_Tests=ON \
-DDisable_Docker_MPI_Tests=OFF \
-DVTK_DIR=/usr/local/lib/cmake/vtk-9.3 \
-DMETIS_DIR=/usr/lib \
.. && \
make -j 2 && \
make install

52 changes: 52 additions & 0 deletions .circleci/Docker/Dockerfile-noble
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -------------------------------------------
# Copyright (c) 2021 - 2024 Prashant K. Jha
# -------------------------------------------
# PeriDEM https://github.com/prashjha/PeriDEM
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE)

# base ubuntu image with essentials and vtk
FROM prashjha/peridem-base-noble:latest

# Set metadata
LABEL maintainer="Prashant K. Jha <pjha.sci@gmail.com>"
LABEL description="PeriDEM docker image"

## build command
## docker build -t prashjha/peridem-noble:latest -f ./Dockerfile-noble . 2>&1 | tee log-peridem-noble.txt

# -----------------------
# setup user (for mpi tests)
# username - user
# password - password
# add only if the user does not exist
# -----------------------
RUN if id user >/dev/null 2>&1; then echo "User 'user' already exists"; else echo "User 'user' does not exist so creating user 'user'" && useradd -m user && yes password | passwd user && usermod -s /bin/bash user; fi

# change user
USER user
WORKDIR /home/user

# -----------------------
# setup git pull method
# -----------------------
RUN git config --global url."https://github.com/".insteadOf git@github.com: && \
git config --global url."https://".insteadOf git://

# -----------------------
# build peridem
# -----------------------
RUN git clone https://github.com/prashjha/PeriDEM.git &&\
cd PeriDEM && \
mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release \
-DEnable_Tests=ON \
-DDisable_Docker_MPI_Tests=OFF \
-DVTK_DIR=/usr/local/lib/cmake/vtk-9.3 \
-DMETIS_DIR=/usr/lib \
.. && \
make -j 2 && \
make install

216 changes: 216 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
# -------------------------------------------
# Copyright (c) 2021 - 2024 Prashant K. Jha
# -------------------------------------------
# PeriDEM https://github.com/prashjha/PeriDEM
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE)

version: 2.1
parameters:
docker-img-os:
type: string
default: noble
cmake-include-dirs:
type: string
default: -DVTK_DIR=/usr/local/lib/cmake/vtk-9.3 -DMETIS_DIR=/usr/lib

commands:
libcmake:
parameters:
cmake-args:
type: string
default: -DCMAKE_BUILD_TYPE=Release -DEnable_Tests=ON -DEnable_Documentation=OFF -DDisable_Docker_MPI_Tests=OFF <<pipeline.parameters.cmake-include-dirs>>
steps:
- run:
name: Cmake configure
command: |
mkdir -p build
cd build
cmake <<parameters.cmake-args>> ..
libmake:
steps:
- run:
name: Make build
command: |
cd build
make -j 2
libtest:
parameters:
verb-flag:
type: string
default: --extra-verbose
steps:
- run:
name: Ctest
command: |
cd build
ctest <<parameters.verb-flag>>
libdoc:
steps:
- run:
name: Make documentation
command: |
cd build
make doc
jobs:
build:
docker:
- image: prashjha/peridem-base-<<pipeline.parameters.docker-img-os>>:latest
user: user
steps:
- checkout
- libcmake
- libmake
- libtest
documentation:
docker:
- image: prashjha/peridem-base-<<pipeline.parameters.docker-img-os>>:latest
user: user
steps:
- checkout
- libcmake:
cmake-args: -DCMAKE_BUILD_TYPE=Release -DEnable_Tests=ON -DEnable_Documentation=ON -DDisable_Docker_MPI_Tests=OFF <<pipeline.parameters.cmake-include-dirs>>
- libdoc
- run:
name: Push doc files to gh-pages
command: |
# source - https://blog.frederikring.com/articles/deploying-github-pages-circle-ci/
echo "list project/docs directory"
ls -a ./docs/
echo "Begin clone and copy. pwd = $(pwd)"
echo "CIRCLE_BRANCH = $CIRCLE_BRANCH"
#echo "CIRCLE_REPOSITORY_URL = $CIRCLE_REPOSITORY_URL"
#echo "CIRCLE_PROJECT_REPONAME = $CIRCLE_PROJECT_REPONAME"
#echo "CIRCLE_PROJECT_USERNAME = $CIRCLE_PROJECT_USERNAME"
if [ $CIRCLE_BRANCH == "main" ]; then
echo "set github config"
git config --global user.email "pjha.sci@gmail.com"
git config --global user.name "Prashant K. Jha"
echo "clone for gh-pages. pwd = $(pwd)"
cd ..
git clone $CIRCLE_REPOSITORY_URL build_docs

cd build_docs
echo "checkout gh-pages branch"
git checkout gh-pages || git checkout --orphan gh-pages

echo "clean the branch"
git rm -rf . 1> /dev/null
git add . && git commit -m "cleaning" 1> /dev/null

echo "create .nojekyll file"
touch .nojekyll

echo "create docs directory"
mkdir -p docs
ls -a

echo "begin copying. pwd = $(pwd)"
echo "copy repo directory except 'docs' and '.git' directories"
rsync -a --stats ../project/ ./ --exclude build --exclude docs --exclude .git
rsync -a --stats ../project/docs/ ./docs/ --exclude doxy --exclude doxy.log

echo "copying docs/doxy/html into ./"
rsync -a --stats ../project/docs/doxy/html/ ./

echo "removing .gitignore file"
rm .gitignore

echo "check if files are copied"
if [ -f "./index.html" ]; then
echo "files copied successfully."
else
echo "index.html file does not exist"
fi

echo "add changes and commit"
git add -A
git commit -m "automated deployment to GitHub Pages: ${CIRCLE_SHA1}" --allow-empty

echo "push"
git push -q https://${G_TOKEN}@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git gh-pages
fi
deploy:
machine:
image: ubuntu-2004:current
environment:
IMAGE_FILE_NAME: .circleci/Docker/Dockerfile-<<pipeline.parameters.docker-img-os>>
IMAGE_NAME: peridem-<<pipeline.parameters.docker-img-os>>:latest
steps:
- checkout
- run:
name: Build docker image
command: |
docker build -t prashjha/${IMAGE_NAME} -f ${IMAGE_FILE_NAME} .
docker images
- run:
name: Deploy to docker hub
command: |
if [ "${CIRCLE_BRANCH}" == "main" ]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push prashjha/${IMAGE_NAME}
fi
- run:
name: Deploy to github
command: |
if [ "${CIRCLE_BRANCH}" == "main" ]; then
## OLD
# docker login docker.pkg.github.com -u prashjha -p ${G_TOKEN}
# docker tag prashjha/${IMAGE_NAME} docker.pkg.github.com/prashjha/peridem/${IMAGE_NAME}
# docker push docker.pkg.github.com/prashjha/peridem/${IMAGE_NAME}
## new github container namespace
docker login ghcr.io -u prashjha -p ${G_TOKEN}
docker tag prashjha/${IMAGE_NAME} ghcr.io/prashjha/peridem/${IMAGE_NAME}
docker push ghcr.io/prashjha/peridem/${IMAGE_NAME}
fi
codecoverage:
docker:
- image: prashjha/peridem-base-<<pipeline.parameters.docker-img-os>>:latest
user: user
steps:
- checkout
- libcmake:
cmake-args: -DCMAKE_BUILD_TYPE=Release -DEnable_Tests=ON -DDisable_Docker_MPI_Tests=OFF -DCMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage -fpic" <<pipeline.parameters.cmake-include-dirs>>
- libmake
- libtest
- run:
name: Report
command: |
cd build
gcovr -e ../build -e ../external -e ../examples -e ../tools --r ..
- run:
name: Publish
command: |
if [ "${CIRCLE_BRANCH}" == "main" ]; then
cd build
#coveralls --gcov-options '\-lp' -t ${CODECOV_TOKEN}
bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN}
fi
workflows:
version: 2
build_doc_deploy_codecov:
jobs:
- build:
filters:
branches:
ignore: gh-pages
- documentation:
filters:
branches:
only: main
- codecoverage:
filters:
branches:
only: main
requires:
- build
# - deploy:
# filters:
# branches:
# only: main
# requires:
# - build
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Expected Behavior

... Please describe the behavior you would have expected.

## Actual Behavior

... Please describe the behavior you actually observed.


## Steps to Reproduce the Problem

... Please be as specific as possible while describing how to reproduce your problem.

1.
1.
1.

## Specifications

... Please describe your environment

- HPX Version:
- Platform (compiler, OS):

10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

Fixes #

## Proposed Changes

-
-
-

## Any background context you want to provide?
14 changes: 14 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test:
- tests/*
code:
- src/*
documentaiton:
- docs/*
examples:
- examples/*
build:
- CMakeLists.txt
cmake:
- cmake/*
tools:
- tools/*
19 changes: 19 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "0 0 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
Loading

0 comments on commit d8de0cb

Please sign in to comment.