Skip to content

Commit

Permalink
update to v0.2.0 (#23)
Browse files Browse the repository at this point in the history
* update from cryptogarageinc/cfd v0.2.7 (#23)

Co-authored-by: k-matsuzawa <[email protected]>
  • Loading branch information
ko-matsu and k-matsuzawa authored Oct 28, 2020
1 parent 7b1ab85 commit 680ffb8
Show file tree
Hide file tree
Showing 21 changed files with 1,550 additions and 565 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/check_pre-merge_sprint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,50 +62,13 @@ jobs:
os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04]
shared: [on]
elements: [on]
cmake_cache: [false]
# Currently using cmake 3.17.0 by default
# exclude:
# - os: ubuntu-18.04
# cmake_cache: false
# - os: ubuntu-16.04
# cmake_cache: false
# include:
# - os: ubuntu-18.04
# cmake_cache: true
# - os: ubuntu-16.04
# cmake_cache: true

steps:
- uses: actions/checkout@v2
- name: dump version
run: |
cmake --version
gcc --version
- name: cmake-useCache-ubuntu
uses: actions/cache@v1
if: matrix.cmake_cache == 'true'
with:
path: cache/cmake
key: ${{ runner.os }}-cmake-${{ env.CMAKE_VERSION }}-x64-0
restore-keys: |
${{ runner.os }}-cmake-${{ env.CMAKE_VERSION }}-x64-
- name: cmake-download-ubuntu
if: matrix.cmake_cache == 'true' && steps.cache.outputs.cache-hit != 'true'
run: |
mkdir -p cache/cmake
cd cache/cmake
wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz
cd ../..
- name: cmake-setting-ubuntu
if: matrix.cmake_cache == 'true'
run: |
export cmake_file_name="cmake-$CMAKE_VERSION-Linux-x86_64"
cd cache/cmake
tar zxvf $cmake_file_name.tar.gz
chmod +x $cmake_file_name/bin/cmake $cmake_file_name/bin/ctest
export CURRENT_DIR=$(pwd)
echo ::add-path::$CURRENT_DIR/$cmake_file_name/bin
cd ../..
- name: ubuntu-apt-install
run: sudo apt install lcov
- name: cmake-build
Expand All @@ -132,9 +95,6 @@ jobs:
with:
name: output-lcov-cfd-${{ matrix.os }}
path: ./build/lcov_cfd_output.zip
- name: ubuntu-after
if: matrix.cmake_cache == 'true'
run: rm -rf cache/cmake/cmake-$CMAKE_VERSION-Linux-x86_64

doxygen-ubuntu:
name: doxygen-check
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/code_scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: code scan

on:
push:
branches:
- master
- develop
- features/sprint*
- feature/code_scanning
pull_request:
branches:
- master
- develop
- features/sprint*

jobs:
analyze-CodeQL:
name: CodeQL
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['cpp']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# https://git.io/JvXDl

# ️ If the Autobuild fails above, remove it and uncomment the following three lines and modify them (or add more) to build your code if your project uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

OSSAR-Scan:
# OSSAR runs on windows-latest.
# ubuntu-latest and macos-latest support coming soon
runs-on: windows-latest

steps:
# Checkout your code repository to scan
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Ensure a compatible version of dotnet is installed.
# The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201.
# A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action.
# GitHub hosted runners already have a compatible version of dotnet installed and this step may be skipped.
# For self-hosted runners, ensure dotnet version 3.1.201 or later is installed by including this action:
# - name: Install .NET
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: '3.1.x'

# Run open source static analysis tools
- name: Run OSSAR
uses: github/ossar-action@v1
id: ossar

# Upload results to the Security tab
- name: Upload OSSAR results
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ steps.ossar.outputs.sarifFile }}
92 changes: 31 additions & 61 deletions .github/workflows/create_release-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ on:
tags:
- 'v*'

env:
CMAKE_VERSION: 3.17.2

jobs:
create-releases:
create_releases:
name: create-releases
runs-on: ubuntu-latest
outputs:
release_url: ${{ steps.output_url.outputs.upload_url }}

steps:
- name: checkout
Expand All @@ -30,23 +29,24 @@ jobs:
- Second Change
draft: false
prerelease: true
# continue-on-error: true
- name: write upload url
continue-on-error: true
- name: Get release
if: steps.create_release.outcome == 'failure'
id: get_release
uses: bruceadams/[email protected]
env:
url: ${{ steps.create_release.outputs.upload_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: output url
id: output_url
run: |
echo $url > upload_url.txt
- name: upload artifact
uses: actions/upload-artifact@v1
with:
name: artifact-upload_url
path: upload_url.txt
echo "::set-output name=upload_url::${{steps.get_release.outputs.upload_url}}${{steps.create_release.outputs.upload_url}}"
upload-object-windows:
name: upload-object-win
needs: create-releases
needs: create_releases
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
bin: [vs2019, vs2019-static, gcc, gcc-static]
include:
Expand All @@ -66,17 +66,9 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v2
- name: download artifact
uses: actions/download-artifact@v1
with:
name: artifact-upload_url
- name: dump upload url
- name: output url
id: get_url
run: |
export up_url="$(cat artifact-upload_url/upload_url.txt)"
echo "::set-output name=upload_url::$up_url"
echo "url=$up_url"
shell: bash
run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}"
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Expand Down Expand Up @@ -125,9 +117,10 @@ jobs:

upload-object-ubuntu:
name: upload-object-ubuntu
needs: create-releases
needs: create_releases
runs-on: ubuntu-${{ matrix.os_ver }}.04
strategy:
fail-fast: false
matrix:
# os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04]
os_ver: [20, 18, 16]
Expand Down Expand Up @@ -162,15 +155,9 @@ jobs:
zip -r cfd.zip usr
echo "---- dump zip file ----"
ls -l
- name: download artifact
uses: actions/download-artifact@v1
with:
name: artifact-upload_url
- name: dump upload url
- name: output url
id: get_url
run: |
url=$(cat artifact-upload_url/upload_url.txt)
echo ::set-output name=upload_url::$url
run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}"
- name: Upload Release Asset
uses: actions/[email protected]
env:
Expand All @@ -183,7 +170,7 @@ jobs:

upload-object-alpine-3-10:
name: upload-object-alpine-3.10
needs: create-releases
needs: create_releases
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -213,15 +200,9 @@ jobs:
sudo cp -rp /tmp/cfd/cfd.zip $GITHUB_WORKSPACE/dist/cfd.zip
echo "---- dump zip file ----"
sudo ls -l /tmp/cfd
- name: download artifact
uses: actions/download-artifact@v1
with:
name: artifact-upload_url
- name: dump upload url
- name: output url
id: get_url
run: |
url=$(cat artifact-upload_url/upload_url.txt)
echo ::set-output name=upload_url::$url
run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}"
- name: Upload Release Asset
id: upload-release-asset
# if: success()
Expand All @@ -236,7 +217,7 @@ jobs:

upload-object-alpine-3-12:
name: upload-object-alpine-3.12
needs: create-releases
needs: create_releases
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -266,15 +247,9 @@ jobs:
sudo cp -rp /tmp/cfd/cfd.zip $GITHUB_WORKSPACE/dist/cfd.zip
echo "---- dump zip file ----"
sudo ls -l /tmp/cfd
- name: download artifact
uses: actions/download-artifact@v1
with:
name: artifact-upload_url
- name: dump upload url
- name: output url
id: get_url
run: |
url=$(cat artifact-upload_url/upload_url.txt)
echo ::set-output name=upload_url::$url
run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}"
- name: Upload Release Asset
id: upload-release-asset
# if: success()
Expand All @@ -289,9 +264,10 @@ jobs:

upload-object-macos:
name: upload-object-macos
needs: create-releases
needs: create_releases
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
xcode: [10.3, 11.6]
shared: [on, off]
Expand Down Expand Up @@ -322,22 +298,16 @@ jobs:
cd build
sudo make install DESTDIR=../dist
cd ..
timeout-minutes: 30
timeout-minutes: 40
- name: create archive file
run: |
cd dist
zip -r cfd.zip usr
echo "---- dump zip file ----"
ls -l
- name: download artifact
uses: actions/download-artifact@v1
with:
name: artifact-upload_url
- name: dump upload url
- name: output url
id: get_url
run: |
url=$(cat artifact-upload_url/upload_url.txt)
echo ::set-output name=upload_url::$url
run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}"
- name: Upload Release Asset
uses: actions/[email protected]
env:
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(PACKAGE_VERSION 1.0.0)
include(./cmake/CfdCommonOption.cmake)
include(./cmake/CfdWallyOption.cmake)

option(CFD_SHARED "force shared build (ON or OFF. default:OFF)" OFF)
option(ENABLE_CAPI "enable c-api (ON or OFF. default:ON)" ON)
option(ENABLE_JSONAPI "enable json-api (ON or OFF. default:ON)" ON)

Expand Down
2 changes: 2 additions & 0 deletions cmake/CfdCommonOption.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ endif()

if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(ENABLE_DEBUG TRUE)
set(RPATH_TARGET "Debug")
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUGBUILD>)
if(ENABLE_COVERAGE AND ${ENABLE_COVERAGE})
set(STACK_PROTECTOR_OPT "")
Expand All @@ -31,6 +32,7 @@ set(STACK_PROTECTOR_OPT $<IF:$<CXX_COMPILER_ID:MSVC>,/GS,-fstack-check -fstack-
endif()
else()
set(ENABLE_DEBUG FALSE)
set(RPATH_TARGET "Release")
set(STACK_PROTECTOR_OPT "")
endif() # CMAKE_BUILD_TYPE

Expand Down
2 changes: 1 addition & 1 deletion external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if(CFDCORE_TARGET_VERSION)
set(CFDCORE_TARGET_TAG ${CFDCORE_TARGET_VERSION})
message(STATUS "[external project local] cfd-core target=${CFDCORE_TARGET_VERSION}")
else()
set(CFDCORE_TARGET_TAG v0.1.6)
set(CFDCORE_TARGET_TAG v0.2.0)
endif()
if(CFDCORE_TARGET_URL)
set(CFDCORE_TARGET_REP ${CFDCORE_TARGET_URL})
Expand Down
Loading

0 comments on commit 680ffb8

Please sign in to comment.