Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Conan package in Travis CI #943

Closed
wants to merge 5 commits into from
Closed

Build Conan package in Travis CI #943

wants to merge 5 commits into from

Conversation

uilianries
Copy link
Contributor

@uilianries uilianries commented Jun 30, 2017

To solve the automatic Conan build for each new push, this PR brings a solution by Conan package tools.

All about Conan package tools could be found here

Travis will run build.py by Docker service. It script calls Conan, that export, build and test your package. To upload your package after all tests, you must include some environment variables in your Travis settings.

CONAN_UPLOAD: Your Bintray Conan repository. e.g. https://api.bintray.com/conan/philsquared/conan 
CONAN_PASSWORD: Your Bintray API Key

Why are they not included in travis.yml?
To provide the capability to anyone customize and upload it own package by project fork

Will this work without these environment variables?
Yes. The package will be created and tested in Travis job, but will not be uploaded to Bintray.

Will all packages be sent to the same channel?
No. Only tags (vX.X.X) will be pushed to stable channel. Otherwise, will be sent to ci not be uploaded.

Now, you should decide if you want to create an organization or use your own name. Conan project has documented about how to use Bintray here.

I would like to invite @memsharded to review and discuss about this PR.

Regards.

- Added Travis job to build Conan package for Catch
- Travis scripts to be used in Conan container (intall and run)

Signed-off-by: Uilian Ries <uilianries@gmail.com>
- Catch version is updated in Travis for each new release

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@memsharded
Copy link

Related issue: #926

Copy link

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to process only tags? I don't know, would like to investigate.

pyenv rehash
pyenv activate conan
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to pip install conan first, to ensure that latest conan is installed, and not the one that conan_package_tools might be indirectly requiring.

@@ -9,5 +9,6 @@
v.updateReadmeFile()
v.updateConanFile()
v.updateConanTestFile()
v.updateTravisFile()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only tags are processed, maybe this would be unnecessary.


def updateTravisFile(self):
conanParser = re.compile( r' CONAN_REFERENCE: \"Catch\/\d+\.\d+\.\d+.*\"')
f = open( travisPath, 'r' )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would always suggest the with open(travisPath, "r") as f: context idiom, it makes sure f is closed, automatically

.travis.yml Outdated
CONAN_GCC_VERSIONS: 6.3
CONAN_DOCKER_IMAGE: lasote/conangcc63
CONAN_REFERENCE: Catch/1.9.6
CONAN_CHANNEL: ci

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if possible, but I would say that building/uploading to CI is unnecessary, I would try to only process tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, now is possible. CONAN_UPLOAD_ONLY_WHEN_STABLE was added in conan-package-tools to solve it. Good point, I'll change to only upload tags.

- Send package to Bintray only when branch is stable

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@uilianries
Copy link
Contributor Author

Just adding @lasote to this discussion.

- Updated Travis file routine, to use version as parameter
- Skipped x86 build on Travis -- Catch is header only
- Updated Catch reference in travis.yml to 1.10.0

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@uilianries
Copy link
Contributor Author

Hi!

I merged the master branch on this PR. Now this feature is able again to be merged without conflicts.

Could I help to finish this PR? The last point discussed was about create a Bintray account to push Catch as Conan package.

Regards.

horenmar pushed a commit to uilianries/Catch2 that referenced this pull request Nov 19, 2018
- Apply new conventions introduced on Conan 1.8
- Removed outdated settings
- Update license to follow SPDX format

Closes catchorg#926
Closes catchorg#943
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants