-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e7854e
commit b46f6c7
Showing
1 changed file
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: cppWorkflow | ||
|
||
on: | ||
push: | ||
branches: main | ||
paths: | ||
- 'cpp/**' | ||
- '.github/workflows/cpp.yml' | ||
|
||
env: | ||
NUGETTOKEN: ${{ secrets.NUGET_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SCRIPTS_BASE_URL: https://raw.githubusercontent.com/linksplatform/Scripts/main/MultiProjectRepository | ||
|
||
defaults: | ||
run: | ||
working-directory: cpp | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
submodules: true | ||
- name: Setup clang | ||
uses: egor-tensin/setup-clang@v1 | ||
with: | ||
version: 13 | ||
platform: x64 | ||
- name: Install conan | ||
run: pip install conan | ||
- name: Setup conan | ||
run: | | ||
conan profile new linksplatform --detect | ||
conan profile update settings.compiler=clang linksplatform | ||
conan profile update settings.compiler.version=13 linksplatform | ||
conan profile update settings.compiler.libcxx=libstdc++11 linksplatform | ||
conan profile update env.CXX=clang++ linksplatform | ||
conan profile show linksplatform | ||
- name: Instll conan packages | ||
run: | | ||
if [ -f "install-local-conan-dependencies.sh" ]; then | ||
echo "install-local-conan-dependencies.sh exists." | ||
./install-local-conan-dependencies.sh | ||
fi | ||
- name: Test and scan-build | ||
run: | | ||
CXX=clang++ | ||
cmake_flags="-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ -DLINKS_PLATFORM_TESTS=TRUE" | ||
cmake_build_dir="build" | ||
mkdir $cmake_build_dir && cd $cmake_build_dir | ||
conan install .. -pr=linksplatform --build=missing | ||
cmake .. "$cmake_flags" | ||
cmake --build . | ||
ls | ||
pushToNuget: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
submodules: true | ||
- name: Read package information | ||
run: | | ||
export REPOSITORY_NAME=$(basename ${{ github.repository }}) | ||
wget "$SCRIPTS_BASE_URL/read_cpp_package_info.sh" | ||
bash ./read_cpp_package_info.sh | ||
- name: Publish NuGet package | ||
run: | | ||
export REPOSITORY_NAME=$(basename ${{ github.repository }}) | ||
wget "$SCRIPTS_BASE_URL/push-cpp-nuget.sh" | ||
bash ./push-cpp-nuget.sh | ||
publiseRelease: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
submodules: true | ||
- name: Read project information | ||
run: | | ||
export REPOSITORY_NAME=$(basename ${{ github.repository }}) | ||
wget "$SCRIPTS_BASE_URL/read_cpp_package_info.sh" | ||
bash ./read_cpp_package_info.sh | ||
- name: Publish release | ||
run: | | ||
export REPOSITORY_NAME=$(basename ${{ github.repository }}) | ||
wget "$SCRIPTS_BASE_URL/publish-release.sh" | ||
chmod +x ./publish-release.sh | ||
wget "$SCRIPTS_BASE_URL/publish-cpp-release.sh" | ||
bash ./publish-cpp-release.sh |