diff --git a/.github/workflows/test-valgrind.yml b/.github/workflows/test-valgrind.yml index 3ebea9439..41a61a775 100644 --- a/.github/workflows/test-valgrind.yml +++ b/.github/workflows/test-valgrind.yml @@ -1,29 +1,27 @@ name: Test valgrind on: + workflow_dispatch: schedule: - cron: '13 6 * * *' - workflow_dispatch: - inputs: - scripts_test_options: - description: 'Extra options for scripts/test.py.' jobs: valgrind: - name: Test valgrind - runs-on: ${{ matrix.os }} + name: valgrind + runs-on: ubuntu-latest strategy: matrix: - os: [ubuntu-latest] - + args: [ + '', + '-m "git:--branch master https://github.com/ArtifexSoftware/mupdf"', + '-m "git:--branch 1.26.x https://github.com/ArtifexSoftware/mupdf"', + ] + fail-fast: false + steps: - - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - - - name: test_mupdf-master-branch - env: - PYMUDF_SCRIPTS_TEST_options: ${{inputs.scripts_test_options}} + - name: valgrind run: - python scripts/test.py -m 'git:--recursive --depth 1 --shallow-submodules --branch master https://github.com/ArtifexSoftware/mupdf.git' -P 1 --valgrind 1 buildtest + python scripts/test.py ${{matrix.args}} -P 1 --valgrind 1 build test diff --git a/.github/workflows/test_pyodide.yml b/.github/workflows/test_pyodide.yml index ab8b652b0..24c2adb6f 100644 --- a/.github/workflows/test_pyodide.yml +++ b/.github/workflows/test_pyodide.yml @@ -1,57 +1,39 @@ name: Build Pyodide wheel +# Builds pyodide wheels. + on: workflow_dispatch: - inputs: - PYMUPDF_SETUP_MUPDF_BUILD: - description: 'Value for PYMUPDF_SETUP_MUPDF_BUILD, e.g.: git:--branch master https://github.com/ArtifexSoftware/mupdf.git' - type: string - #default: 'git:--branch master https://github.com/ArtifexSoftware/mupdf.git' - default: '-' - PYMUPDF_SETUP_PY_LIMITED_API: - type: string - default: '1' - schedule: - cron: '13 5 * * *' jobs: - build_pyodide: - - name: Build pyodide wheel + pyodide: + name: pyodide runs-on: ubuntu-latest - strategy: matrix: - # Python version needs to match emsdk. - python-version: ["3.12"] - - # Avoid cancelling of all runs after a single failure. + args: [ + '', + '-m "git:--branch master https://github.com/ArtifexSoftware/mupdf"', + '-m "git:--branch 1.26.x https://github.com/ArtifexSoftware/mupdf"', + ] fail-fast: false steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} - - - name: build_pyodide_wheel - env: - inputs_sdist: 0 - inputs_PYMUPDF_SETUP_MUPDF_BUILD: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD}} - PYMUPDF_SETUP_PY_LIMITED_API: ${{inputs.PYMUPDF_SETUP_PY_LIMITED_API}} - inputs_wheels_default: 0 - inputs_wheels_linux_pyodide: 1 + python-version: 3.12 + + - name: pyodide run: - python scripts/gh_release.py build - - - # Upload generated wheels, to be accessible from github Actions page. - # - - uses: actions/upload-artifact@v4 - with: - path: ./wheelhouse/*.whl + python scripts/test.py ${{matrix.args}} pyodide + + # We do not use upload-artifact@v4 because it fails due to us creating + # identically-named wheels. + #- uses: actions/upload-artifact@v4 + # with: + # path: ./wheelhouse/*.whl diff --git a/scripts/test.py b/scripts/test.py index 973a404b5..32e5da997 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -144,6 +144,9 @@ [This simply sSets $PYMUPDF_SETUP_PY_LIMITED_API, which is used by PyMuPDF/setup.py.] + --show-args: + Show sys.argv and exit. For debugging. + --sync-paths Do not run anything, instead write required files/directories/checkouts to stdout, one per line. This is to help with automated running on @@ -278,6 +281,7 @@ def main(argv): pyodide_build_version = None pytest_options = '' pytest_prefix = None + show_args = False show_help = False sync_paths = False system_site_packages = False @@ -388,6 +392,8 @@ def main(argv): assert _value in ('0', '1'), f'`-s` must be followed by `0` or `1`, not {_value=}.' env_extra['PYMUPDF_SETUP_PY_LIMITED_API'] = _value + elif arg == '--show-args': + show_args = 1 elif arg == '--sync-paths': sync_paths = True @@ -439,6 +445,12 @@ def main(argv): print(__doc__) return + if show_args: + print(f'sys.argv ({len(sys.argv)}):') + for arg in sys.argv: + print(f' {arg!r}') + return + if os_names: if platform.system().lower() not in os_names: log(f'Not running because {platform.system().lower()=} not in {os_names=}') @@ -905,7 +917,7 @@ def getmtime(path): for test_name in test_names: pytest_arg += f' {pymupdf_dir_rel}/{test_name}' else: - pytest_arg += f' {pymupdf_dir_rel}' + pytest_arg += f' {pymupdf_dir_rel}/tests' python = gh_release.relpath(sys.executable) log('Running tests with tests/run_compound.py and pytest.') @@ -940,7 +952,7 @@ def getmtime(path): command += ( f' valgrind' f' --suppressions={pymupdf_dir_abs}/valgrind.supp' - f' --trace-children=yes' + f' --trace-children=no' f' --num-callers=20' f' --error-exitcode=100' f' --errors-for-leak-kinds=none' @@ -952,7 +964,7 @@ def getmtime(path): command = ( f' valgrind' f' --tool=helgrind' - f' --trace-children=yes' + f' --trace-children=no' f' --num-callers=20' f' --error-exitcode=100' f' --fullpath-after='