diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index baadda253..028a06922 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -1,11 +1,11 @@ name: Build docs on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/link_checker.yml b/.github/workflows/link_checker.yml index 6b5240dc9..8d6086d3e 100644 --- a/.github/workflows/link_checker.yml +++ b/.github/workflows/link_checker.yml @@ -17,6 +17,7 @@ concurrency: jobs: link-checker: + if: github.repository == 'sony/model_optimization' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -26,6 +27,7 @@ jobs: python-version: 3.10.* - name: Install dependencies run: | + echo "Triggered by ${{ github.actor }}" python -m pip install --upgrade pip pip install requests==2.27.1 - name: Run unittests diff --git a/.github/workflows/run_tests_python310_keras214.yml b/.github/workflows/run_tests_python310_keras214.yml index 586e4c874..3ef9180ea 100644 --- a/.github/workflows/run_tests_python310_keras214.yml +++ b/.github/workflows/run_tests_python310_keras214.yml @@ -1,11 +1,11 @@ name: Python 3.10, Keras 2.14 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python310_keras215.yml b/.github/workflows/run_tests_python310_keras215.yml index 78cd31f22..f25e10e59 100644 --- a/.github/workflows/run_tests_python310_keras215.yml +++ b/.github/workflows/run_tests_python310_keras215.yml @@ -1,11 +1,11 @@ name: Python 3.10, Keras 2.15 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python310_pytorch22.yml b/.github/workflows/run_tests_python310_pytorch22.yml index 7d31ab6bd..aa640d4a7 100644 --- a/.github/workflows/run_tests_python310_pytorch22.yml +++ b/.github/workflows/run_tests_python310_pytorch22.yml @@ -1,11 +1,11 @@ name: Python 3.10, Pytorch 2.2 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python310_pytorch23.yml b/.github/workflows/run_tests_python310_pytorch23.yml index 08f1b3632..1105bd2c5 100644 --- a/.github/workflows/run_tests_python310_pytorch23.yml +++ b/.github/workflows/run_tests_python310_pytorch23.yml @@ -1,11 +1,11 @@ name: Python 3.10, Pytorch 2.3 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python310_pytorch24.yml b/.github/workflows/run_tests_python310_pytorch24.yml index 133be02ec..a421cd36d 100644 --- a/.github/workflows/run_tests_python310_pytorch24.yml +++ b/.github/workflows/run_tests_python310_pytorch24.yml @@ -1,11 +1,11 @@ name: Python 3.10, Pytorch 2.4 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python310_pytorch25.yml b/.github/workflows/run_tests_python310_pytorch25.yml index 31e63c5e8..efa25aa98 100644 --- a/.github/workflows/run_tests_python310_pytorch25.yml +++ b/.github/workflows/run_tests_python310_pytorch25.yml @@ -1,11 +1,11 @@ name: Python 3.10, Pytorch 2.5 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python311_keras214.yml b/.github/workflows/run_tests_python311_keras214.yml index 6a74772a3..26f1aeec9 100644 --- a/.github/workflows/run_tests_python311_keras214.yml +++ b/.github/workflows/run_tests_python311_keras214.yml @@ -1,11 +1,11 @@ name: Python 3.11, Keras 2.14 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python311_keras215.yml b/.github/workflows/run_tests_python311_keras215.yml index 503a95e27..1f1af8d2c 100644 --- a/.github/workflows/run_tests_python311_keras215.yml +++ b/.github/workflows/run_tests_python311_keras215.yml @@ -1,11 +1,11 @@ name: Python 3.11, Keras 2.15 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python311_pytorch22.yml b/.github/workflows/run_tests_python311_pytorch22.yml index 0fbb6e7f5..96d75961b 100644 --- a/.github/workflows/run_tests_python311_pytorch22.yml +++ b/.github/workflows/run_tests_python311_pytorch22.yml @@ -1,11 +1,11 @@ name: Python 3.11, Pytorch 2.2 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python311_pytorch23.yml b/.github/workflows/run_tests_python311_pytorch23.yml index 134b17c5b..15664fd71 100644 --- a/.github/workflows/run_tests_python311_pytorch23.yml +++ b/.github/workflows/run_tests_python311_pytorch23.yml @@ -1,11 +1,11 @@ name: Python 3.11, Pytorch 2.3 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python311_pytorch24.yml b/.github/workflows/run_tests_python311_pytorch24.yml index d762dfa63..ea8f4ddc8 100644 --- a/.github/workflows/run_tests_python311_pytorch24.yml +++ b/.github/workflows/run_tests_python311_pytorch24.yml @@ -1,11 +1,11 @@ name: Python 3.11, Pytorch 2.4 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python311_pytorch25.yml b/.github/workflows/run_tests_python311_pytorch25.yml index 72dd479e8..d92f89c19 100644 --- a/.github/workflows/run_tests_python311_pytorch25.yml +++ b/.github/workflows/run_tests_python311_pytorch25.yml @@ -1,11 +1,11 @@ name: Python 3.11, Pytorch 2.5 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python312_pytorch22.yml b/.github/workflows/run_tests_python312_pytorch22.yml index e40fb32b5..73241a463 100644 --- a/.github/workflows/run_tests_python312_pytorch22.yml +++ b/.github/workflows/run_tests_python312_pytorch22.yml @@ -1,11 +1,11 @@ name: Python 3.12, Pytorch 2.2 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python312_pytorch23.yml b/.github/workflows/run_tests_python312_pytorch23.yml index c261924d0..acfe1b1ad 100644 --- a/.github/workflows/run_tests_python312_pytorch23.yml +++ b/.github/workflows/run_tests_python312_pytorch23.yml @@ -1,11 +1,11 @@ name: Python 3.12, Pytorch 2.3 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python312_pytorch24.yml b/.github/workflows/run_tests_python312_pytorch24.yml index abf35ba87..bd7ef850a 100644 --- a/.github/workflows/run_tests_python312_pytorch24.yml +++ b/.github/workflows/run_tests_python312_pytorch24.yml @@ -1,11 +1,11 @@ name: Python 3.12, Pytorch 2.4 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python312_pytorch25.yml b/.github/workflows/run_tests_python312_pytorch25.yml index 20a56b3f5..08455ff4f 100644 --- a/.github/workflows/run_tests_python312_pytorch25.yml +++ b/.github/workflows/run_tests_python312_pytorch25.yml @@ -1,11 +1,11 @@ name: Python 3.12, Pytorch 2.5 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python39_keras214.yml b/.github/workflows/run_tests_python39_keras214.yml index 29203850e..a0d136699 100644 --- a/.github/workflows/run_tests_python39_keras214.yml +++ b/.github/workflows/run_tests_python39_keras214.yml @@ -1,11 +1,11 @@ name: Python 3.9, Keras 2.14 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python39_keras215.yml b/.github/workflows/run_tests_python39_keras215.yml index 11d94b5f9..d5a14d272 100644 --- a/.github/workflows/run_tests_python39_keras215.yml +++ b/.github/workflows/run_tests_python39_keras215.yml @@ -1,11 +1,11 @@ name: Python 3.9, Keras 2.15 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python39_pytorch22.yml b/.github/workflows/run_tests_python39_pytorch22.yml index a79c4ea69..7509b1028 100644 --- a/.github/workflows/run_tests_python39_pytorch22.yml +++ b/.github/workflows/run_tests_python39_pytorch22.yml @@ -1,11 +1,11 @@ name: Python 3.9, Pytorch 2.2 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python39_pytorch23.yml b/.github/workflows/run_tests_python39_pytorch23.yml index f852bae7a..957db018d 100644 --- a/.github/workflows/run_tests_python39_pytorch23.yml +++ b/.github/workflows/run_tests_python39_pytorch23.yml @@ -1,11 +1,11 @@ name: Python 3.9, Pytorch 2.3 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python39_pytorch24.yml b/.github/workflows/run_tests_python39_pytorch24.yml index abeddc38c..77d6be9ce 100644 --- a/.github/workflows/run_tests_python39_pytorch24.yml +++ b/.github/workflows/run_tests_python39_pytorch24.yml @@ -1,11 +1,11 @@ name: Python 3.9, Pytorch 2.4 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_python39_pytorch25.yml b/.github/workflows/run_tests_python39_pytorch25.yml index 78f9a6bd2..5f552834d 100644 --- a/.github/workflows/run_tests_python39_pytorch25.yml +++ b/.github/workflows/run_tests_python39_pytorch25.yml @@ -1,11 +1,11 @@ name: Python 3.9, Pytorch 2.5 on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/run_tests_suite_coverage.yml b/.github/workflows/run_tests_suite_coverage.yml index d916c0da9..7c2d7dd71 100644 --- a/.github/workflows/run_tests_suite_coverage.yml +++ b/.github/workflows/run_tests_suite_coverage.yml @@ -1,11 +1,11 @@ name: Coverage Test on: workflow_dispatch: # Allow manual triggers - schedule: - - cron: 0 0 * * * - pull_request: - branches: - - main +# schedule: +# - cron: 0 0 * * * +# pull_request: +# branches: +# - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/tests/doc_tests/test_docs_links.py b/tests/doc_tests/test_docs_links.py index 8f06a5598..91980a2ca 100644 --- a/tests/doc_tests/test_docs_links.py +++ b/tests/doc_tests/test_docs_links.py @@ -13,6 +13,7 @@ # limitations under the License. # ============================================================================== import unittest +from time import sleep import subprocess from shutil import rmtree from os import walk, getcwd, getenv @@ -29,8 +30,10 @@ class TestDocsLinks(unittest.TestCase): @staticmethod def check_link(_url, branch_name): + sleep(1) try: - response = requests.get(_url) + response = requests.head(_url, allow_redirects=True) + print(f' ===> Response: {response}') if response.status_code == 200: return True except Exception as e: @@ -67,6 +70,12 @@ def test_readme_and_rst_files(self): _link = link_str.split(']')[-1][1:-1] # replace colab link with actual github link because accessing a broken link through colab doesn't return an error _link = _link.replace('://colab.research.google.com/github/', '://github.com/') + + if '/model_optimization/blob/main/' in _link: + print(f' -> replacing {_link}') + _link = join(mct_folder, _link.split('/model_optimization/blob/main/')[1]) + print(f' -> with {_link}') + if _link[0] == '#': # A link starting with '#' is a local reference to a headline in the current file --> ignore pass @@ -96,6 +105,11 @@ def test_readme_and_rst_files(self): # format: search for a string between <>, which is the link _strs = re.findall(r"<([^<>]+)>", l) for _link in _strs: + if '/model_optimization/blob/main/' in _link: + print(f' -> replacing {_link}') + _link = join(mct_folder, _link.split('/model_optimization/blob/main/')[1]) + print(f' -> with {_link}') + if _link.startswith('ug-'): # A link starting with 'ug-' is a reference to another .rst file --> ignore # This link is checked when generating the docs