This repository has been archived by the owner on May 30, 2024. It is now read-only.
forked from eirikb/proof-of-conan
-
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
0 parents
commit 17911c1
Showing
17 changed files
with
6,004 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,14 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
- package-ecosystem: "pip" | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
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,177 @@ | ||
name: Build PR | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
repository: | ||
required: true | ||
default: 'conan-io/conan-center-index' | ||
pr: | ||
required: true | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
REPOSITORY: ${{ github.event.inputs.repository }} | ||
PR: ${{ github.event.inputs.pr }} | ||
CLICOLOR_FORCE: 1 | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
find_modified_package: | ||
name: Find modified package | ||
runs-on: ubuntu-latest | ||
outputs: | ||
versions: ${{ steps.generate-matrix.outputs.versions }} | ||
recipe_folder: ${{ steps.find-modified-package.outputs.recipe_folder }} | ||
package_name: ${{ steps.find-modified-package.outputs.package_name }} | ||
steps: | ||
- name: find modified package | ||
id: find-modified-package | ||
run: | | ||
gh pr view -R $REPOSITORY $PR --json files --jq '.files[].path' | while read file | ||
do | ||
if [[ $file != recipes/* ]] | ||
then | ||
echo file not in recipes: $file | ||
continue | ||
fi | ||
IFS='/' read -ra my_array <<< "$file" | ||
if [ "${#my_array[@]}" -lt 4 ] | ||
then | ||
echo file too short: $file | ||
continue | ||
fi | ||
package_name=${my_array[1]} | ||
recipe_folder=${my_array[2]} | ||
echo package_name=$package_name | ||
echo recipe_folder=$recipe_folder | ||
echo "package_name=$package_name" >> "$GITHUB_OUTPUT" | ||
echo "recipe_folder=$recipe_folder" >> "$GITHUB_OUTPUT" | ||
break | ||
done | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.8" | ||
- run: pip3 install conan yq | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.inputs.repository }} | ||
sparse-checkout: recipes/${{ steps.find-modified-package.outputs.package_name }}/config.yml | ||
ref: refs/pull/${{ github.event.inputs.pr }}/merge | ||
- name: find modified versions | ||
id: generate-matrix | ||
run: | | ||
version_list=$(yq -c '[.versions | to_entries[] | select(.value.folder=="${{ steps.find-modified-package.outputs.recipe_folder }}").key]' recipes/${{ steps.find-modified-package.outputs.package_name }}/config.yml) | ||
echo version_list=$version_list | ||
echo "versions=$version_list" >> "$GITHUB_OUTPUT" | ||
|
||
- run: | | ||
echo "Building Pull request" >> $GITHUB_STEP_SUMMARY | ||
echo "- repo: $REPOSITORY" >> $GITHUB_STEP_SUMMARY | ||
echo "- PR: #$PR" >> $GITHUB_STEP_SUMMARY | ||
echo "- package: ${{ steps.find-modified-package.outputs.package_name }}" >> $GITHUB_STEP_SUMMARY | ||
echo "- recipe folder: ${{ steps.find-modified-package.outputs.recipe_folder }}" >> $GITHUB_STEP_SUMMARY | ||
echo "- versions: ${{ steps.generate-matrix.outputs.versions }}" >> $GITHUB_STEP_SUMMARY | ||
_: | ||
runs-on: ${{ matrix.os }} | ||
needs: | ||
- find_modified_package | ||
name: ${{ needs.find_modified_package.outputs.package_name }}/${{ matrix.version }} ${{ matrix.shared }} ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-11] | ||
shared: ["True", "False"] | ||
version: ${{ fromJSON(needs.find_modified_package.outputs.versions) }} | ||
continue-on-error: true | ||
env: | ||
NOT_ON_C3I: 1 | ||
GH_TOKEN: ${{ github.token }} | ||
REPOSITORY: ${{ github.event.inputs.repository }} | ||
PR: ${{ github.event.inputs.pr }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.inputs.repository }} | ||
sparse-checkout: recipes/${{ needs.find_modified_package.outputs.package_name }}/${{ needs.find_modified_package.outputs.recipe_folder }} | ||
ref: refs/pull/${{ github.event.inputs.pr }}/merge | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.8" | ||
- run: pip3 install conan yq | ||
|
||
- name: set conan home | ||
if: ${{ runner.os == 'Windows' }} | ||
shell: bash | ||
run: echo "CONAN_HOME=${{ runner.temp }}\\.c2" >> $GITHUB_ENV | ||
|
||
- run: conan profile detect --force | ||
shell: bash | ||
|
||
- name: conan create | ||
id: conan_create | ||
shell: bash | ||
env: | ||
CONAN_SYSREQUIRES_MODE: enabled | ||
run: | | ||
echo "| os | shared | cppstd | version | result |" >> $GITHUB_STEP_SUMMARY | ||
echo "| -- | ------ | ------ | ------- | ------ |" >> $GITHUB_STEP_SUMMARY | ||
PROFILE_PATH=$(conan profile path default) | ||
COMPILER=$(awk -F "=" '/^compiler=/ {print $2}' $PROFILE_PATH) | ||
COMPILER_VERSION=$(awk -F "=" '/^compiler.version=/ {print $2}' $PROFILE_PATH) | ||
echo "$PROFILE_PATH $COMPILER $COMPILER_VERSION" | ||
CPP_STDS=$(curl https://github.com/conan-io/conan-center-index/raw/master/.c3i/config_v2.yml -L | yq -r -c .cppstd.\"$COMPILER\".\"$COMPILER_VERSION\"[]) | ||
for cpp_std in $CPP_STDS; do | ||
cpp_std=$(echo $cpp_std | tr -d '[:space:]') | ||
conan_command="-s:a compiler.cppstd=$cpp_std --version ${{ matrix.version }} recipes/${{ needs.find_modified_package.outputs.package_name }}/${{ needs.find_modified_package.outputs.recipe_folder }} -o */*:shared=${{ matrix.shared }} -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=True" | ||
set +e | ||
conan create $conan_command 2> >(tee conan_output >&2) | ||
code=${PIPESTATUS[0]} | ||
set -e | ||
echo $code | ||
case $code in | ||
0) | ||
ICON=":white_check_mark:" | ||
;; | ||
6) | ||
ICON=":arrow_right_hook:" | ||
;; | ||
1) | ||
ICON=":x:" | ||
;; | ||
*) | ||
ICON=":interrobang: $code" | ||
;; | ||
esac | ||
if grep -Fq "conan graph explain" conan_output; then | ||
conan graph explain $conan_command | ||
fi | ||
if grep -Fq "conan graph info" conan_output; then | ||
conan graph info $conan_command --format=html >graph.html | ||
fi | ||
echo "| ${{ matrix.os }} | ${{ matrix.shared }} | $cpp_std | ${{ matrix.version }} | $ICON |" >> $GITHUB_STEP_SUMMARY | ||
if [ $code -ne 6 ]; then | ||
exit "$code" | ||
fi | ||
done | ||
exit 0 | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ failure() && steps.conan_create.conclusion == 'failure' }} | ||
with: | ||
name: graph_${{ needs.find_modified_package.outputs.package_name }}_${{ matrix.version }}_${{ matrix.shared }}_${{ matrix.os }} | ||
path: graph.html | ||
if-no-files-found: ignore | ||
|
||
Post_Result: | ||
name: Post results | ||
needs: [_] | ||
runs-on: ubuntu-latest | ||
if: ${{ !cancelled() }} | ||
steps: | ||
- run: GH_TOKEN=${{ secrets.GH_TOKEN }} gh issue comment -R $REPOSITORY $PR -b "The build is now finished. You can take a look at the results [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }})" |
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,25 @@ | ||
name: GH Pages | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v4 | ||
|
||
- run: npm i | ||
- run: ./node_modules/.bin/parcel build src/index.html --public-url . | ||
|
||
- name: GitHub Pages | ||
uses: crazy-max/ghaction-github-pages@v4 | ||
with: | ||
build_dir: dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,100 @@ | ||
name: Manual trigger | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
repository: | ||
required: true | ||
default: 'conan-io/conan-center-index' | ||
ref: | ||
required: true | ||
default: 'master' | ||
path: | ||
required: true | ||
default: 'recipes/qt/6.x.x' | ||
version: | ||
required: true | ||
default: '6.5.1' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
summary: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo "Building Conan Package" >> $GITHUB_STEP_SUMMARY | ||
echo "- repo: ${{ github.event.inputs.repository }}" >> $GITHUB_STEP_SUMMARY | ||
echo "- gitref: ${{ github.event.inputs.ref }}" >> $GITHUB_STEP_SUMMARY | ||
echo "- path: ${{ github.event.inputs.path }}" >> $GITHUB_STEP_SUMMARY | ||
echo "- version: ${{ github.event.inputs.version }}" >> $GITHUB_STEP_SUMMARY | ||
_: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-11] | ||
shared: ["True", "False"] | ||
continue-on-error: true | ||
env: | ||
NOT_ON_C3I: 1 | ||
PKG_VERSION: ${{ github.event.inputs.version }} | ||
PKG_PATH: ${{ github.event.inputs.path }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.inputs.repository }} | ||
ref: ${{ github.event.inputs.ref }} | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.8" | ||
- run: pip3 install conan yq | ||
|
||
- name: set conan home | ||
if: ${{ runner.os == 'Windows' }} | ||
shell: bash | ||
run: echo "CONAN_HOME=${{ runner.temp }}\\.c2" >> $GITHUB_ENV | ||
|
||
- run: conan profile detect --force | ||
shell: bash | ||
|
||
- name: conan create | ||
shell: bash | ||
env: | ||
CONAN_SYSREQUIRES_MODE: enabled | ||
run: | | ||
echo "| os | shared | cppstd | result |" >> $GITHUB_STEP_SUMMARY | ||
echo "| -- | ------ | ------ | ------ |" >> $GITHUB_STEP_SUMMARY | ||
PROFILE_PATH=$(conan profile path default) | ||
COMPILER=$(awk -F "=" '/^compiler=/ {print $2}' $PROFILE_PATH) | ||
COMPILER_VERSION=$(awk -F "=" '/^compiler.version=/ {print $2}' $PROFILE_PATH) | ||
echo "$PROFILE_PATH $COMPILER $COMPILER_VERSION" | ||
CPP_STDS=$(curl https://github.com/conan-io/conan-center-index/raw/master/.c3i/config_v2.yml -L | yq -r -c .cppstd.\"$COMPILER\".\"$COMPILER_VERSION\"[]) | ||
for cpp_std in $CPP_STDS; do | ||
cpp_std=$(echo $cpp_std | tr -d '[:space:]') | ||
code=0 | ||
set +o pipefail | ||
conan create -s compiler.cppstd=$cpp_std --version $PKG_VERSION --build=missing $PKG_PATH -o */*:shared=${{ matrix.shared }} -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=True || code=$? | ||
echo $code | ||
case $code in | ||
0) | ||
ICON=":white_check_mark:" | ||
;; | ||
6) | ||
ICON=":arrow_right_hook:" | ||
;; | ||
1) | ||
ICON=":x:" | ||
;; | ||
*) | ||
ICON=":interrobang: $code" | ||
;; | ||
esac | ||
echo "| ${{ matrix.os }} | ${{ matrix.shared }} | $cpp_std | $ICON |" >> $GITHUB_STEP_SUMMARY | ||
if [ $code -ne 6 ]; then | ||
break | ||
fi | ||
done | ||
exit "$code" |
Oops, something went wrong.