From 2541f97a3a0ffea27010368f6d959477ce1b4672 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sat, 13 Apr 2024 02:43:06 -0400 Subject: [PATCH] TEMP: no other actions --- .circleci/config.yml | 225 ------------------ .github/workflows/labeler.yml | 21 -- .../workflows/redirect_circleci_artifacts.yml | 18 -- .github/workflows/schemacode_ci.yml | 170 ------------- .github/workflows/validation.yml | 98 -------- 5 files changed, 532 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .github/workflows/labeler.yml delete mode 100644 .github/workflows/redirect_circleci_artifacts.yml delete mode 100644 .github/workflows/schemacode_ci.yml delete mode 100644 .github/workflows/validation.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index ee82d5b003..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,225 +0,0 @@ -version: 2.1 -jobs: - build_docs: - docker: - - image: cimg/python:3.12-node - steps: - # checkout code to default ~/project - - checkout - - run: - name: install dependencies - command: | - python -m venv env - source env/bin/activate - python -m pip install --upgrade pip - pip install -r requirements.txt - - run: - name: generate docs - command: | - source env/bin/activate - mkdocs build --clean --strict --verbose - - persist_to_workspace: - # the mkdocs build outputs are in ~/project/site - root: ~/project - paths: - - site - - store_artifacts: - path: ~/project/site/ - destination: dev_docs - - check_links: - docker: - - image: cimg/python:3.12 - steps: - # checkout code to default ~/project - - checkout - - attach_workspace: - # mkdocs build outputs will be in ~/project/site - at: ~/project - - run: - name: install linkchecker - command: | - python -m venv env - source env/bin/activate - python -m pip install --upgrade pip - python -m pip install linkchecker - - run: - name: check links - command: | - source env/bin/activate - git status - if (! git log -1 --pretty=oneline | grep REL:) ; then - chmod a+rX -R ~ - linkchecker -t 1 ~/project/site/ - # check external separately by pointing to all *html so no - # failures for local file:/// -- yoh found no better way, - linkchecker -t 1 --check-extern \ - --ignore-url 'file:///.*' \ - --ignore-url 'https://fonts.gstatic.com' \ - --ignore-url 'https://github.com/bids-standard/bids-specification/(pull|tree)/.*' \ - --ignore-url 'https://github.com/[^/]*' \ - --ignore-url 'https://doi.org/.*' \ - --ignore-url 'https://bids-specification.readthedocs.io/en/stable/.*' \ - ~/project/site/*html ~/project/site/*/*.html - else - echo "Release PR - do nothing" - fi - - build_docs_pdf: - docker: - - image: texlive/texlive:latest - steps: - # checkout code to default ~/project - - checkout - - run: - name: install dependencies - command: | - apt-get update && apt install -y python3-pip python3-venv pandoc - python3 -m venv .venv - source .venv/bin/activate - python3 -m pip install --upgrade pip - python3 -m pip install -r ~/project/requirements.txt - python3 -m pip install ~/project/tools/schemacode/[render] - - run: - name: install font that works with unicode emojis - command: apt-get update && apt-get install -y fonts-symbola - - run: - name: generate pdf version docs - command: | - source .venv/bin/activate - cd ~/project/pdf_build_src - bash build_pdf.sh - mv ~/project/pdf_build_src/bids-spec.pdf ~/project/bids-spec.pdf - - store_artifacts: - path: bids-spec.pdf - - # Automatically generate a changelog since migration from Google Docs to GitHub - github_changelog_generator: - docker: - - image: ferrarimarco/github-changelog-generator:1.14.3 - steps: - - setup_remote_docker: - version: 18.06.0-ce - # checkout code to default ~/project - - checkout - - run: - name: Build changelog - # $CHANGE_TOKEN is generated via the GitHub web UI, and then securely stored within CircleCI web UI - command: | - mkdir ~/changelog_build - git status - if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then - github_changelog_generator \ - --exclude-tags-regex "^(?!v).*?$" \ - --user bids-standard \ - --project bids-specification \ - --token ${CHANGE_TOKEN} \ - --output ~/changelog_build/CHANGES.md \ - --base ~/project/src/pregh-changes.md \ - --header-label "# Changelog" \ - --release-branch master \ - --no-issues \ - --no-filter-by-milestone \ - --no-compare-link \ - --pr-label "" \ - --enhancement-label "" \ - --bugs-label "" \ - --exclude-labels "exclude-from-changelog" - cat ~/changelog_build/CHANGES.md - else - echo "Commit or Release, do nothing" - fi - - persist_to_workspace: - # raw generated changelog in ~/changelog_build/CHANGES.md - root: ~/. - paths: - - changelog_build - - # Lint and fix the auto generated changes.md file - lint_generated_changelog: - docker: - - image: cimg/node:lts - steps: - # checkout code to default ~/project - - checkout - - attach_workspace: - # the freshly built CHANGES.md will be in ~/changelog_build/CHANGES.md - at: ~/. - - run: - name: install remark and extensions - command: npm install `cat npm-requirements.txt` - - run: - name: remark on autogenerated CHANGES.md - # format changelog, then use sed to change * to -, then lint changelog - command: | - git status - if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then - head -n 100 ~/changelog_build/CHANGES.md - npx remark-cli ~/changelog_build/CHANGES.md --rc-path ~/project/.remarkrc --output ~/changelog_build/CHANGES.md - head -n 100 ~/changelog_build/CHANGES.md - sed -i 's/* /- /' ~/changelog_build/CHANGES.md - head -n 100 ~/changelog_build/CHANGES.md - npx remark-cli ~/changelog_build/CHANGES.md --frail --rc-path ~/project/.remarkrc - else - echo "Commit or Release, do nothing" - fi - - persist_to_workspace: - # linted and fixed changelog in ~/changelog_build/CHANGES.md - root: ~/. - paths: - - changelog_build - - # Push built changelog to repo - commit_generated_changelog: - docker: - - image: cimg/base:stable - steps: - - setup_remote_docker: - version: 17.11.0-ce - # checkout code to default ~/project - - checkout - - attach_workspace: - # fixed+linted changelog in ~/changelog_build/CHANGES.md - at: ~/. - - run: - name: Changelog deployment - # $CHANGE_TOKEN is generated via the GitHub web UI, and then securely stored within CircleCI web UI - command: | - if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then - mv ~/changelog_build/CHANGES.md ~/project/src/CHANGES.md - merge_message=$(git log -1 | grep Merge | grep "pull") - PR_number=$(echo $merge_message | cut -d ' ' -f 4) - git config credential.helper 'cache --timeout=120' - git config user.email "bids.maintenance@gmail.com" - git config user.name "bids-maintenance" - git add ~/project/src/CHANGES.md - git commit -m "[DOC] Auto-generate changelog entry for PR ${PR_number}" - git push https://${CHANGE_TOKEN}@github.com/bids-standard/bids-specification.git master - else - echo "Commit or Release, do nothing" - fi - -workflows: - search_build: - jobs: - - build_docs - - check_links: - requires: - - build_docs - - github_changelog_generator: - filters: - branches: - only: master - - lint_generated_changelog: - requires: - - github_changelog_generator - filters: - branches: - only: master - - commit_generated_changelog: - requires: - - lint_generated_changelog - filters: - branches: - only: master - - build_docs_pdf diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index 355ce3d2de..0000000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Label PRs" -# See https://github.com/marketplace/actions/auto-labeler - -on: - - pull_request_target: - types: [opened] - -jobs: - - labeler: - runs-on: ubuntu-latest - - if: github.repository_owner == 'bids-standard' - - steps: - - name: Check Labels - id: labeler - uses: jimschubert/labeler-action@v2 - with: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/redirect_circleci_artifacts.yml b/.github/workflows/redirect_circleci_artifacts.yml deleted file mode 100644 index c40e051249..0000000000 --- a/.github/workflows/redirect_circleci_artifacts.yml +++ /dev/null @@ -1,18 +0,0 @@ -on: [status] - -jobs: - circleci_artifacts_redirector_job: - runs-on: ubuntu-latest - if: "${{ startsWith(github.event.context, 'ci/circleci: build_docs_pdf') }}" - permissions: - statuses: write - name: Run CircleCI artifacts redirector - steps: - - name: GitHub Action step - uses: larsoner/circleci-artifacts-redirector-action@master - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - api-token: ${{ secrets.CIRCLECI_TOKEN }} - artifact-path: 0/bids-spec.pdf - circleci-jobs: build_docs_pdf - job-title: Check the rendered PDF version here! diff --git a/.github/workflows/schemacode_ci.yml b/.github/workflows/schemacode_ci.yml deleted file mode 100644 index 6cf4dbcd4c..0000000000 --- a/.github/workflows/schemacode_ci.yml +++ /dev/null @@ -1,170 +0,0 @@ -name: "schemacode_ci" - -on: - push: - branches: - - "master" - tags: - - "schema-*" - pull_request: - branches: - - "*" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: ["ubuntu-latest"] - python-version: ["3.11"] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: "Install build dependencies" - run: pip install --upgrade build twine - - name: "Install test dependencies on tag" - run: pip install --upgrade pytest pyyaml pandas tabulate markdown-it-py pyparsing - if: ${{ startsWith(github.ref, 'refs/tags/schema-') }} - - name: "Build archive on tag" - run: pytest tools/schemacode/bidsschematools -k make_archive - env: - BIDSSCHEMATOOLS_RELEASE: 1 - if: ${{ startsWith(github.ref, 'refs/tags/schema-') }} - - name: "Build source distribution and wheel" - run: python -m build tools/schemacode - - name: "Check distribution metadata" - run: twine check tools/schemacode/dist/* - - uses: actions/upload-artifact@v4 - with: - name: dist - path: tools/schemacode/dist/ - - test: - runs-on: ${{ matrix.os }} - needs: [build] - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest"] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - include: - - os: macos-latest - python-version: 3 - - os: windows-latest - python-version: 3 - name: ${{ matrix.os }} with Python ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v4 - - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - allow-prereleases: true - - - name: "Display Python version" - run: python -c "import sys; print(sys.version)" - - - name: "Fetch packages" - uses: actions/download-artifact@v4 - with: - name: dist - path: dist/ - - - name: "Install package" - run: | - pip install $( ls dist/*.whl )[all] - - - name: "Run tests" - run: | - python -m pytest -vs --pyargs bidsschematools -m "not validate_schema" \ - --cov-append --cov-report=xml --cov=bidsschematools --doctest-modules - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: unit_${{ matrix.os }}_${{ matrix.python-version }} - path: coverage.xml - if: success() - - publish: - runs-on: ${{ matrix.os }} - name: Publish Python Package - needs: [test] - if: github.event_name == 'push' - strategy: - matrix: - os: ["ubuntu-latest"] - python-version: ["3.11"] - steps: - - name: "Fetch packages" - uses: actions/download-artifact@v4 - with: - name: dist - path: dist/ - - name: "Test PyPI upload" - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ - skip_existing: true - - name: "Upload to PyPI (on tags)" - if: startsWith(github.ref, 'refs/tags/schema-') - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - - validate_schema: - runs-on: ubuntu-latest - name: Validate schema - steps: - - uses: actions/checkout@v4 - - - name: Set Up Python environment - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: Install the schemacode package - run: | - python -m pip install --progress-bar off --upgrade pip setuptools wheel - python -m pip install -e ./tools/schemacode[all] - - - name: Run schema validation tests - run: python -m pytest --pyargs bidsschematools -m "validate_schema" --cov-append --cov-report=xml --cov=bidsschematools - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: schema_validation - path: coverage.xml - if: success() - - upload_to_codecov: - runs-on: "ubuntu-latest" - name: Upload coverage - needs: [test, validate_schema] - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download artifacts - uses: actions/download-artifact@v4 - - - name: Upload to CodeCov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} # not required but might help API rate limits - fail_ci_if_error: true diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml deleted file mode 100644 index 5be42a5b18..0000000000 --- a/.github/workflows/validation.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- -name: Validation - -on: - push: - branches: [master] - pull_request: - branches: [master] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - # Check for common misspellings - codespell: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: codespell-project/actions-codespell@master - - # Markdown formatting - remark: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 14 - - name: Install dependencies - run: npm install `cat npm-requirements.txt` - - name: Run style checks - run: npx remark src/**/*.md --frail --rc-path .remarkrc - - # YAML - yamllint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3 - - name: Install dependencies - run: pip install yamllint - - name: Lint yml files in src/schema - run: yamllint -f standard src/schema/ -c .yamllint.yml - - # Python best practices - python-style: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3 - - run: python -m pip install --upgrade flake8 black isort[colors] - - run: black --diff --color --check tools/schemacode - - run: isort --diff --color --check tools/schemacode - - run: flake8 - working-directory: tools/schemacode - - # Avoid Latin phrases to improve readability - latin-phrases: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r tools/requirements.txt - - name: Run Python script to check for Latin phrases - Master - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - run: | - python no-bad-latin.py - working-directory: tools - - name: Run Python script to check for Latin phrases - Pull Request - if: github.event.pull_request - run: | - python no-bad-latin.py - working-directory: tools - - # Validate CITATION.cff - validate_cff: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3 - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - pip3 install cffconvert - - name: Validate CITATION.cff - run: make validate_citation_cff