GH actions: conan

This commit is contained in:
Michele Caini
2019-09-24 12:55:39 +02:00
parent f5c231aa80
commit 1319fe2eb5
9 changed files with 50 additions and 78 deletions

View File

@@ -1,4 +1,4 @@
name: coveralls
name: coverage
on: [push, pull_request]
@@ -34,4 +34,4 @@ jobs:
run: |
pip install --upgrade wheel
pip install cpp-coveralls
coveralls --gcov gcov-7 --gcov-options '\-lp' -r . -b ./build -x cpp -x hpp -e ./deps -i ./src
coveralls --gcov gcov-7 --gcov-options '\-lp' -r . -b build -x cpp -x hpp -e deps -i src

33
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: deploy
on:
push:
tags:
- v*
jobs:
conan:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: docker://conanio/gcc8
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@master
with:
version: 3.6
- name: Install
run: |
chmod +x conan/ci/install.sh
./conan/ci/install.sh
- name: Deploy
env:
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_LOGIN_USERNAME }}
CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }}
CONAN_UPLOAD: ${{ secrets.CONAN_UPLOAD }}
CONAN_GCC_VERSIONS: 8
run: |
chmod +x conan/ci/build.sh
./conan/ci/build.sh

View File

@@ -2,38 +2,6 @@ language: cpp
dist: trusty
sudo: false
env:
global:
- CONAN_USERNAME="skypjack"
- CONAN_PACKAGE_NAME="entt"
- CONAN_HEADER_ONLY="True"
- NON_CONAN_DEPLOYMENT="True"
conan-buildsteps: &conan-buildsteps
before_install:
# use this step if you desire to manipulate CONAN variables programmatically
- NON_CONAN_DEPLOYMENT="False"
install:
- chmod +x ./conan/ci/install.sh
- ./conan/ci/install.sh
script:
- chmod +x ./conan/ci/build.sh
- ./conan/ci/build.sh
# the following are dummies to overwrite default build steps
before_script:
- true
after_success:
- true
if: tag IS present
conan-linux: &conan-linux
os: linux
sudo: required
language: python
python: "3.6"
services:
- docker
<<: *conan-buildsteps
matrix:
include:
- os: linux
@@ -54,9 +22,6 @@ matrix:
osx_image: xcode10
compiler: clang
env: COMPILER=clang++
# Conan testing and uploading
- <<: *conan-linux
env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/gcc8
notifications:
email:
@@ -75,10 +40,3 @@ script:
- mkdir -p build && cd build
- cmake -DBUILD_TESTING=ON -DBUILD_LIB=ON .. && make -j4
- CTEST_OUTPUT_ON_FAILURE=1 ctest --timeout 5 -C Debug -j4
deploy:
provider: script
script: scripts/update_packages.sh $TRAVIS_TAG
on:
tags: true
condition: “$NON_CONAN_DEPLOYMENT = “True”

View File

@@ -219,11 +219,12 @@ endif()
# AOB
#
FILE(GLOB GH_WORKFLOWS .github/workflows/*.yml)
add_custom_target(
entt_aob
SOURCES
.github/workflows/ci.yml
.github/workflows/coveralls.yml
${GH_WORKFLOWS}
.github/FUNDING.yml
appveyor.yml
AUTHORS

4
TODO
View File

@@ -35,7 +35,5 @@ TODO
* nested groups: AB/ABC/ABCD/... (hints: sort, check functions)
* GH actions:
- get rid of travis/appveyor
- badge(s) from github actions
- deploy doc (github pages) on tags
- rebuild single file somehow, somewhere
- conan on tags

View File

@@ -4,24 +4,19 @@ from cpt.packager import ConanMultiPackager
import os
if __name__ == "__main__":
username = os.getenv("GITHUB_ACTOR")
tag_version = os.getenv("GITHUB_REF")
tag_package = os.getenv("GITHUB_REPOSITORY")
login_username = os.getenv("CONAN_LOGIN_USERNAME")
username = os.getenv("CONAN_USERNAME")
tag_version = os.getenv("CONAN_PACKAGE_VERSION", os.getenv("TRAVIS_TAG"))
package_version = tag_version.replace("v", "")
package_name_unset = "SET-CONAN_PACKAGE_NAME-OR-CONAN_REFERENCE"
package_name = os.getenv("CONAN_PACKAGE_NAME", package_name_unset)
package_version = tag_version.replace("refs/tags/v", "")
package_name = tag_package.replace("skypjack/", "")
reference = "{}/{}".format(package_name, package_version)
channel = os.getenv("CONAN_CHANNEL", "stable")
upload = os.getenv("CONAN_UPLOAD")
stable_branch_pattern = os.getenv("CONAN_STABLE_BRANCH_PATTERN", r"v\d+\.\d+\.\d+.*")
test_folder = os.getenv("CPT_TEST_FOLDER", os.path.join("conan", "test_package"))
upload_only_when_stable = os.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", True)
header_only = os.getenv("CONAN_HEADER_ONLY", False)
pure_c = os.getenv("CONAN_PURE_C", False)
disable_shared = os.getenv("CONAN_DISABLE_SHARED_BUILD", "False")
if disable_shared == "True" and package_name == package_name_unset:
raise Exception("CONAN_DISABLE_SHARED_BUILD: True is only supported when you define CONAN_PACKAGE_NAME")
builder = ConanMultiPackager(username=username,
reference=reference,
@@ -31,9 +26,6 @@ if __name__ == "__main__":
stable_branch_pattern=stable_branch_pattern,
upload_only_when_stable=upload_only_when_stable,
test_folder=test_folder)
if header_only == "False":
builder.add_common_builds(pure_c=pure_c)
else:
builder.add()
filtered_builds = []

View File

@@ -21,18 +21,11 @@ install(
DESTINATION share/${PROJECT_NAME}-${PROJECT_VERSION}/
)
FILE(GLOB MD_FILES md/*.md)
add_custom_target(
docs_aob
SOURCES
dox/extra.dox
md/core.md
md/entity.md
md/faq.md
md/lib.md
md/links.md
md/locator.md
md/meta.md
md/process.md
md/resource.md
md/signal.md
${MD_FILES}
)

View File

@@ -41,14 +41,14 @@ echo "Sedding..."
# change the url in the formula file
# the slashes in the URL must be escaped
ESCAPED_URL="$(sed -e 's/[\/&]/\\&/g' <<< "$URL")"
ESCAPED_URL="$(echo "$URL" | sed -e 's/[\/&]/\\&/g')"
sed -i -e '/url/s/".*"/"'$ESCAPED_URL'"/' $FORMULA
# change the hash in the formula file
sed -i -e '/sha256/s/".*"/"'$HASH'"/' $FORMULA
# delete temporary file created by sed
rm "$FORMULA-e"
rm -rf "$FORMULA-e"
# update remote repo
echo "Gitting..."

View File

@@ -1,3 +0,0 @@
#!/bin/sh
scripts/update_homebrew.sh $1