Skip to content

Commit

Permalink
🔧 Backport Conan 2.0 migration improvements for 1.x CI (#394)
Browse files Browse the repository at this point in the history
* porting changes from

0d98ba7

* fix our recipe for `conan create` migration

f479a22

* add back-end python requirements

* add flags for better break downs with codecov
  • Loading branch information
Chris Mc authored Sep 6, 2023
1 parent 73f3da7 commit 79e7a4f
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-conan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: "Install and configure the conan client for use in the user-managem
runs:
using: "composite"
steps:
- run: python3 -m pip install "conan<2" --upgrade
- run: python3 -m pip install -r backend/requirements.txt
shell: bash
- run: conan config init --force
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
with:
file: backend/build/coverage.info
name: cpp-backend-unit-tests
flags: backend-unit-tests
fail_ci_if_error: true

macos:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ jobs:
with:
file: frontend/coverage/lcov.info
name: react-frontend-unit-tests
flags: frontend-unit-tests
fail_ci_if_error: true

frontend:
Expand Down
4 changes: 3 additions & 1 deletion backend/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM alpine:3.16

ADD backend/requirements.txt /tmp

RUN apk update && apk add --no-cache \
gcc g++ build-base linux-headers \
cmake bash libstdc++ perl tar git \
py-pip && pip install "conan<2"
py-pip && pip install -r /tmp/requirements.txt
16 changes: 5 additions & 11 deletions backend/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ class UserManagementConanFile(ConanFile):
license = "MIT"
url = "https://github.com/prince-chrismc/user-management"
description = "An open-source application delivering a responsive user management experience."
package_type = "application"
settings = "os", "compiler", "build_type", "arch"
options = {"logging": ["console", "syslog"]}
default_options = {"logging": "syslog", "restinio:with_openssl": True}
default_options = {"logging": "syslog", "restinio/*:with_openssl": True}

def layout(self):
# Describe mono repo structure
Expand Down Expand Up @@ -56,16 +57,9 @@ def build(self):
cmake.build()

def package(self):
self.copy("*.hpp", src=".")
self.copy("*.lib", dst="lib", keep_path=False)
self.copy("*.dll", dst="bin", keep_path=False)
self.copy("*.so", dst="lib", keep_path=False)
self.copy("*.dylib", dst="lib", keep_path=False)
self.copy("*.a", dst="lib", keep_path=False)
self.copy("*user_database_app", dst="bin", keep_path=False)

def package_info(self):
self.cpp_info.libs = ["user-management"]
# TODO(prince-chrismc): Revisit requirements when we look into deploying
copy(self, "*.hpp", src=path.join(self.source_folder, "include"), dst=path.join(self.package_folder, "include"))
copy(self, "*user_database_app", src=path.join(self.build_folder, "src"), dst=path.join(self.package_folder, "bin"), keep_path=False)

def deploy(self):
self.copy("user_database_app", src="bin", dst="bin")
2 changes: 1 addition & 1 deletion backend/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In order to get started you will need to satisfy the following requirements:

- C++14 capable build environment
- CMake v3.19 (recommend v3.23 to take advantage of presets when working locally)
- Conan v1.51 (but less then 2) `pip install "conan<2"`
- Conan v1.51 (but less then 2) `pip install -r requirements.txt`

### Conan Configuration

Expand Down
2 changes: 1 addition & 1 deletion backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
conan>=1.51.0
conan>=1.51.0,<2
cmake-format>=0.6
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ This repository contains a distributed cloud native application comprised of two

| Component | Build | Coverage |
| --- | --- | --- |
| Back-end | [![C++ CI](https://github.com/prince-chrismc/user-management/workflows/C++%20CI/badge.svg)](https://github.com/prince-chrismc/user-management/actions?query=workflow%3A%22C%2B%2B+CI%22)| [![Coverage Status](https://coveralls.io/repos/github/prince-chrismc/user-management/badge.svg?branch=main)](https://coveralls.io/github/prince-chrismc/user-management?branch=main) |
| Back-end | [![C++ CI](https://github.com/prince-chrismc/user-management/workflows/C++%20CI/badge.svg)](https://github.com/prince-chrismc/user-management/actions?query=workflow%3A%22C%2B%2B+CI%22)| [![codecov](https://img.shields.io/codecov/c/github/prince-chrismc/user-management)](https://codecov.io/gh/prince-chrismc/user-management) |
| Front-end | [![Node.js CI](https://github.com/prince-chrismc/user-management/workflows/Node.js%20CI/badge.svg)](https://github.com/prince-chrismc/user-management/actions?query=workflow%3A%22Node.js+CI%22) | [![codecov](https://img.shields.io/codecov/c/github/prince-chrismc/user-management)](https://codecov.io/gh/prince-chrismc/user-management) |

0 comments on commit 79e7a4f

Please sign in to comment.