From 39709519773e466f472dfbb3ad7e0a104d4f76d6 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sat, 27 Jul 2024 17:56:50 +0300 Subject: [PATCH] CI: test automatic README.md updating --- .github/README_TEMPLATE.md | 19 ++++ .github/workflows/daily.yml | 52 +++++++++++ .github/workflows/hooks-warnings.yml | 84 ----------------- .github/workflows/linter-conan-v2.yml | 124 -------------------------- .github/workflows/linter-yaml.yml | 118 ------------------------ .github/workflows/markdown-links.yml | 18 ---- .github/workflows/mlc_config.json | 13 --- .github/workflows/on-push-do-doco.yml | 30 ------- .github/workflows/stale.yml | 63 ------------- 9 files changed, 71 insertions(+), 450 deletions(-) create mode 100644 .github/README_TEMPLATE.md create mode 100644 .github/workflows/daily.yml delete mode 100644 .github/workflows/hooks-warnings.yml delete mode 100644 .github/workflows/linter-conan-v2.yml delete mode 100644 .github/workflows/linter-yaml.yml delete mode 100644 .github/workflows/markdown-links.yml delete mode 100644 .github/workflows/mlc_config.json delete mode 100644 .github/workflows/on-push-do-doco.yml delete mode 100644 .github/workflows/stale.yml diff --git a/.github/README_TEMPLATE.md b/.github/README_TEMPLATE.md new file mode 100644 index 00000000000000..50d13f87948fb8 --- /dev/null +++ b/.github/README_TEMPLATE.md @@ -0,0 +1,19 @@ +

+ +

+ +This is a fork of Conan Center Index containing recipes and changes by @valgur not yet merged to the main Conan Center Index. + +You can add this repo as a Conan remote with the following commands: + +``` +git clone https://github.com/valgur/conan-center-index.git cci-valgur +conan remote add cci-valgur "$PWD/cci-valgur" +``` + +## Added recipes and versions + +Here is a list of package versions that are not available on the main CCI as of : + + + diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml new file mode 100644 index 00000000000000..56f7d2d2080b82 --- /dev/null +++ b/.github/workflows/daily.yml @@ -0,0 +1,52 @@ +name: "Update README daily" +on: + push: +# schedule: +# - cron: "33 3 * * *" +# workflow_dispatch: +jobs: + update_readme: + runs-on: ubuntu-latest + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install prereqs + run: pip install -U yq +# - name: Get local package versions +# shell: bash +# run: | +# set -o pipefail +# cd recipes +# find * -maxdepth 1 -name config.yml | sort | while read f; do pkg=$(dirname "$f"); yq --raw-output '.versions | "'"$pkg/"'" + keys_unsorted[]' $f | sort; done | tee valgur.list + - name: Checkout upstream + run: | + git remote add upstream https://github.com/conan-io/conan-center-index.git + git fetch upstream + git checkout upstream/master +# - name: Get upstream package versions +# shell: bash +# run: | +# set -o pipefail +# cd recipes +# find * -maxdepth 1 -name config.yml | sort | while read f; do pkg=$(dirname "$f"); yq --raw-output '.versions | "'"$pkg/"'" + keys_unsorted[]' $f | sort; done | tee conan-io.list +# - name: Compare package versions +# run: cd recipes && comm -13 conan-io.list valgur.list | tee diff.list + - name: Update README + run: | + set -o pipefail + git remote -v + git checkout origin/dev + # Add a '- ' before each item in diff.list + sed -i 's/^/- /' recipes/diff.list + # Replace with today's date and with the diff + sed "s//$(date +%Y-%m-%d)/" .github/README_TEMPLATE.md | sed "//r recipes/diff.list" | sed "//d" | tee README.md +# - uses: stefanzweifel/git-auto-commit-action@v5 +# with: +# commit_message: "Daily README.md update" +# file_pattern: "README.md" diff --git a/.github/workflows/hooks-warnings.yml b/.github/workflows/hooks-warnings.yml deleted file mode 100644 index e19b8ea189eb5f..00000000000000 --- a/.github/workflows/hooks-warnings.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: hooks warnings - -on: - issue_comment: - types: [created] - -jobs: - comment: - if: ${{ github.event.issue.pull_request && github.event.sender.login == 'conan-center-bot' }} - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v6 - with: - script: | - warnings_map = new Map() - const link_regex = /\[All logs\]\((?https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*))\)/g; - for (const match of context.payload.comment.body.matchAll(link_regex)) - { - prefix = "https://c3i.jfrog.io/c3i/misc/summary.html?json=" - if(!match.groups.url.startsWith(prefix)) - continue; - url = match.groups.url.slice(prefix.length) - try { - result = await github.request({ - url: url, - }); - } catch(err) { - core.warning(`error ${err.status} for url ${err.request.url}`) - continue - } - for (const job of result.data) - { - if (job.build == null) - continue; - try { - log = await github.request({ - baseUrl: "https://c3i.jfrog.io/c3i/misc/", - url: job.build, - }); - } catch(err) { - core.warning(`error ${err.status} for url ${err.request.url}`) - continue - } - prefix = "[HOOK - conan-center.py] " - warnings = log.data.split("\n").filter(line => line.startsWith(prefix) && line.includes(" WARN: ")) - if(warnings.length == 0) - continue - if(!warnings_map.has(job.reference)) - warnings_map.set(job.reference, new Set()) - for(const warning of warnings) - { - msg = warning.slice(prefix.length) - warnings_map.get(job.reference).add(msg) - core.warning(msg) - } - } - } - if(warnings_map.size > 0) - { - comment = "
\n" - comment += "Hooks produced the following warnings" - const shaRegex = /(All green|Failure) in build \d+ \(`(?(\d|[a-z])+)`\):/g; - const shaMatch = shaRegex.exec(context.payload.comment.body) - if(shaMatch) - { - comment += " for commit " + shaMatch.groups.sha - } - comment += "\n\n" - for (const [ref, warnings] of warnings_map) - { - comment += "
\n" - comment += "" + ref + "\n\n```\n" - for(const warning of warnings) - comment += warning + "\n" - comment += "```\n
\n" - } - comment += "
\n" - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment - }) - } diff --git a/.github/workflows/linter-conan-v2.yml b/.github/workflows/linter-conan-v2.yml deleted file mode 100644 index 9b437a26e46d8a..00000000000000 --- a/.github/workflows/linter-conan-v2.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: "[linter] Conan v2 migration" - -on: - pull_request: - -env: - PYTHONPATH: ${{github.workspace}} - PYVER: "3.8" - REQUIREMENTS: "pylint==2.14" - -jobs: - test_linter: - name: Test linter changes (v2 migration) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get changed files - uses: ./.github/actions/pr_changed_files - id: changed_files - with: - files: | - linter/** - .github/workflows/linter-conan-v2.yml - - - name: Get Conan v1 version - id: parse_conan_v1_version - if: steps.changed_files.outputs.any_changed == 'true' - uses: mikefarah/yq@master - with: - cmd: yq '.conan.version' '.c3i/config_v1.yml' - - - uses: actions/setup-python@v4 - if: steps.changed_files.outputs.any_changed == 'true' - with: - python-version: ${{ env.PYVER }} - - - name: Install requirements - if: steps.changed_files.outputs.any_changed == 'true' - run: | - pip install ${{ env.REQUIREMENTS }} conan==${{ steps.parse_conan_v1_version.outputs.result }} - - - name: Execute linter over all recipes in the repository - id: linter_recipes - if: steps.changed_files.outputs.any_changed == 'true' - run: | - echo '## Linter summary (recipes)' >> $GITHUB_STEP_SUMMARY - pylint --rcfile=linter/pylintrc_recipe `ls recipes/*/*/conanfile.py | shuf -n 500` --output-format=json --output=recipes.json --score=y --exit-zero - jq '[map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}] | sort_by(.length) | reverse' recipes.json > recipes2.json - jq -r '.[] | " * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY - - - name: Execute linter over all test_package/recipes in the repository - id: linter_test_package - if: steps.changed_files.outputs.any_changed == 'true' - run: | - echo '## Linter summary (test_package)' >> $GITHUB_STEP_SUMMARY - pylint --rcfile=linter/pylintrc_testpackage `ls recipes/*/*/test_package/conanfile.py | shuf -n 500` --output-format=json --output=recipes.json --exit-zero - jq '[map( select(.type=="error")) | group_by (.message)[] | {message: .[0].message, length: length}] | sort_by(.length) | reverse' recipes.json > recipes2.json - jq -r '.[] | " * \(.message): \(.length)"' recipes2.json >> $GITHUB_STEP_SUMMARY - - conanfile_recipe: - name: Lint changed conanfile.py (v2 migration) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get changed files - id: changed-files - uses: ./.github/actions/pr_changed_files - with: - files: | - recipes/*/*/conanfile.py - - name: Get Conan v1 version - id: parse_conan_v1_version - if: steps.changed-files.outputs.any_changed == 'true' - uses: mikefarah/yq@master - with: - cmd: yq '.conan.version' '.c3i/config_v1.yml' - - uses: actions/setup-python@v4 - if: steps.changed-files.outputs.any_changed == 'true' - with: - python-version: ${{ env.PYVER }} - - name: Install dependencies - if: steps.changed-files.outputs.any_changed == 'true' - run: | - pip install ${{ env.REQUIREMENTS }} conan==${{ steps.parse_conan_v1_version.outputs.result }} - - name: Run linter - if: steps.changed-files.outputs.any_changed == 'true' - run: | - echo "::add-matcher::linter/recipe_linter.json" - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - pylint --rcfile=linter/pylintrc_recipe --output-format=parseable ${file} - done - - conanfile_test_package: - name: Lint changed test_package/conanfile.py (v2 migration) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get changed files - id: changed-files - uses: ./.github/actions/pr_changed_files - with: - files: | - recipes/*/*/test_*/conanfile.py - - name: Get Conan v1 version - id: parse_conan_v1_version - if: steps.changed-files.outputs.any_changed == 'true' - uses: mikefarah/yq@master - with: - cmd: yq '.conan.version' '.c3i/config_v1.yml' - - uses: actions/setup-python@v4 - if: steps.changed-files.outputs.any_changed == 'true' - with: - python-version: ${{ env.PYVER }} - - name: Install dependencies - if: steps.changed-files.outputs.any_changed == 'true' - run: | - pip install ${{ env.REQUIREMENTS }} conan==${{ steps.parse_conan_v1_version.outputs.result }} - - name: Run linter - if: steps.changed-files.outputs.any_changed == 'true' - run: | - echo "::add-matcher::linter/recipe_linter.json" - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - pylint --rcfile=linter/pylintrc_testpackage --ignore-paths="recipes/[^/]*/[^/]*/test_v1[^/]*/conanfile.py" --output-format=parseable ${file} - done diff --git a/.github/workflows/linter-yaml.yml b/.github/workflows/linter-yaml.yml deleted file mode 100644 index d7d4050e8071df..00000000000000 --- a/.github/workflows/linter-yaml.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: "[linter] YAML files" - -on: - pull_request: - -env: - PYTHONPATH: ${{github.workspace}} - PYVER: "3.8" - CONFIG_FILES_PATH: "recipes/*/config.yml" - CONANDATA_FILES_PATH: "recipes/*/*/conandata.yml" - -jobs: - test_linter: - # A job to run when the linter changes. We want to know in advance how many files will be broken - name: Test linter changes (YAML files) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get changed files - uses: ./.github/actions/pr_changed_files - id: changed_files - with: - files: | - linter/** - - - uses: actions/setup-python@v4 - if: steps.changed_files.outputs.any_changed == 'true' - with: - python-version: ${{ env.PYVER }} - - - name: Install dependencies - if: steps.changed_files.outputs.any_changed == 'true' - run: pip install yamllint strictyaml argparse - - - name: Run linter (config.yml) - if: steps.changed_files.outputs.any_changed == 'true' && always() - run: | - echo "::add-matcher::linter/yamllint_matcher.json" - yamllint --config-file linter/yamllint_rules.yml -f standard ${{ env.CONFIG_FILES_PATH }} - echo "::remove-matcher owner=yamllint_matcher::" - - - name: Run schema check (config.yml) - if: steps.changed_files.outputs.any_changed == 'true' && always() - run: | - for file in ${{ env.CONFIG_FILES_PATH }}; do - python3 linter/config_yaml_linter.py ${file} - done - - - name: Run linter (conandata.yml) - if: steps.changed_files.outputs.any_changed == 'true' && always() - run: | - echo "::add-matcher::linter/yamllint_matcher.json" - yamllint --config-file linter/yamllint_rules.yml -f standard ${{ env.CONANDATA_FILES_PATH }} - echo "::remove-matcher owner=yamllint_matcher::" - - - name: Run schema check (conandata.yml) - if: steps.changed_files.outputs.any_changed == 'true' && always() - run: | - for file in ${{ env.CONANDATA_FILES_PATH }}; do - python3 linter/conandata_yaml_linter.py ${file} - done - - lint_pr_files: - # Lint files modified in the pull_request - name: Lint changed files (YAML files) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYVER }} - - - name: Install dependencies - run: pip install yamllint strictyaml argparse - - ## Work on config.yml files - - name: Get changed files (config) - id: changed_files_config - if: always() - uses: ./.github/actions/pr_changed_files - with: - files: | - ${{ env.CONFIG_FILES_PATH }} - - - name: Run linter (config.yml) - if: steps.changed_files_config.outputs.any_changed == 'true' && always() - run: | - echo "::add-matcher::linter/yamllint_matcher.json" - for file in ${{ steps.changed_files_config.outputs.all_changed_files }}; do - yamllint --config-file linter/yamllint_rules.yml -f standard ${file} - done - echo "::remove-matcher owner=yamllint_matcher::" - - for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do - python3 linter/config_yaml_linter.py ${file} - done - - ## Work on conandata.yml files - - name: Get changed files (conandata) - id: changed_files_conandata - if: always() - uses: ./.github/actions/pr_changed_files - with: - files: | - ${{ env.CONANDATA_FILES_PATH }} - - - name: Run linter (conandata.yml) - if: steps.changed_files_conandata.outputs.any_changed == 'true' && always() - run: | - echo "::add-matcher::linter/yamllint_matcher.json" - for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do - yamllint --config-file linter/yamllint_rules.yml -f standard ${file} - done - echo "::remove-matcher owner=yamllint_matcher::" - - for file in ${{ steps.changed_files_conandata.outputs.all_changed_files }}; do - python3 linter/conandata_yaml_linter.py ${file} - done diff --git a/.github/workflows/markdown-links.yml b/.github/workflows/markdown-links.yml deleted file mode 100644 index 50c393f373fb13..00000000000000 --- a/.github/workflows/markdown-links.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: "[linter] Markdown links" - -on: - pull_request: - paths: - - '**.md' - -jobs: - markdown-link-check-pr: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - config-file: .github/workflows/mlc_config.json - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - check-modified-files-only: 'yes' diff --git a/.github/workflows/mlc_config.json b/.github/workflows/mlc_config.json deleted file mode 100644 index d16005bb86641e..00000000000000 --- a/.github/workflows/mlc_config.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "retryOn429": true, - "retryCount": 5, - "fallbackRetryDelay": "30s", - "httpHeaders": [ - { - "urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"], - "headers": { - "Accept-Encoding": "zstd, br, gzip, deflate" - } - } - ] -} diff --git a/.github/workflows/on-push-do-doco.yml b/.github/workflows/on-push-do-doco.yml deleted file mode 100644 index 17b68406118dd2..00000000000000 --- a/.github/workflows/on-push-do-doco.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: docs_markdown_toc -on: - workflow_dispatch: - inputs: {} - push: - branches: - - master - paths: - - 'docs/**' - -jobs: - docs_markdown_toc: - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: Run MarkdownSnippets - run: | - dotnet tool install --global MarkdownSnippets.Tool - mdsnippets ${GITHUB_WORKSPACE} \ - --convention InPlaceOverwrite \ - --exclude-directories 'recipes' \ - --toc-level 5 - shell: bash - - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 - with: - branch: bot/action-doc-toc - commit-message: "[docs] Regenerate tables of contents" - title: "[docs] Regenerate tables of contents" - body: "Automatic update of the documentation TOCs." diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 5e391a2d5e8608..00000000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,63 +0,0 @@ -# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. -# -# You can adjust the behavior by modifying this file. -# For more information, see: -# https://github.com/actions/stale -name: Mark stale pull requests - - -on: - schedule: - - cron: '34 6 * * *' - -jobs: - stale: - if: github.repository == 'conan-io/conan-center-index' - - runs-on: ubuntu-latest - permissions: - pull-requests: write - issues: read - - - steps: - - uses: actions/stale@v9 - with: - # Do not make issues as stale - days-before-issue-stale: -1 - # Number of days before stale PRs are closed - days-before-pr-stale: 30 - - - # Do not close issues automatically - days-before-issue-close: -1 - # Idle number of days before closing stale PRs - days-before-pr-close: 30 - - # process older PRs first - ascending: true - - # Labels on PRs exempted from stale - exempt-pr-labels: blocked,infrastructure - - # Label to apply on staled PRs - stale-pr-label: 'stale' - - # Skip issues when having stale state - remove-issue-stale-when-updated: false - ignore-issue-updates: true - - - # Comment on the staled PRs - stale-pr-message: > - This pull request has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. - - # Comment on the staled PRs while closed - close-pr-message: > - This pull request has been automatically closed because it has not had - recent activity. Thank you for your contributions. - - # Max number of operations per run - operations-per-run: 30