CI #3240
This file contains hidden or 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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 8 * * *' | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| coq-version: ['dev', '9.0', '8.20', '8.19', '8.18', '8.17', '8.16', '8.15', '8.14', '8.13', '8.12', '8.11', '8.10', '8.9', '8.8', '8.7', '8.6', '8.5', '8.4'] | |
| ocaml-version: ['default'] | |
| test-location: ['installed', 'local', 'standalone'] | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ matrix.coq-version }}-${{ matrix.ocaml-version }}-docker-${{ matrix.test-location }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: coq-community/docker-coq-action@v1 | |
| with: | |
| coq_version: ${{ matrix.coq-version }} | |
| ocaml_version: ${{ matrix.ocaml-version }} | |
| custom_script: | | |
| sudo chmod -R a=u . | |
| # Work around https://github.com/actions/checkout/issues/766 | |
| git config --global --add safe.directory "*" | |
| startGroup 'install general dependencies' | |
| sudo apt-get update -y | |
| sudo apt-get install -y python3 python3-pip python-is-python3 python3-venv | |
| opam install -y coq | |
| eval $(opam env) | |
| endGroup | |
| startGroup 'make print-support' | |
| make print-support | |
| endGroup | |
| startGroup 'coqc --help' | |
| # Coq 8.10 and earlier error on --help, so we do `|| true` | |
| coqc --help || true | |
| endGroup | |
| startGroup 'coqtop --help' | |
| # Coq 8.10 and earlier error on --help, so we do `|| true` | |
| coqtop --help || true | |
| endGroup | |
| startGroup 'setup venv' | |
| python -m venv .venv | |
| . .venv/bin/activate | |
| endGroup | |
| startGroup 'install package Python deps' | |
| python -m pip install -r requirements.txt | |
| endGroup | |
| startGroup 'install test Python deps' | |
| python -m pip install pytest | |
| endGroup | |
| startGroup 'make pytest' | |
| make pytest PYTHON3=python | |
| endGroup | |
| echo '::remove-matcher owner=coq-problem-matcher::' | |
| if [ "${{ matrix.test-location }}" == "installed" ]; then | |
| startGroup 'install package building deps' | |
| python -m pip install build wheel twine | |
| endGroup | |
| startGroup 'Build package' | |
| make dist | |
| endGroup | |
| startGroup 'Test install' | |
| python -m pip install .[all] | |
| endGroup | |
| make check PYTHON=python3 FIND_BUG=coq-bug-minimizer CAT_ALL_LOGS=1 | |
| elif [ "${{ matrix.test-location }}" == "standalone" ]; then | |
| startGroup 'install package building deps' | |
| python -m pip install --upgrade pip | |
| # pyinstaller and setuptools have some version conflicts, cf https://gemini.google.com/share/7d74f17e6391 | |
| python -m pip install pyinstaller 'setuptools<71' | |
| endGroup | |
| startGroup 'Build package' | |
| make standalone | |
| endGroup | |
| make check FIND_BUG=dist/coq-bug-minimizer/coq-bug-minimizer CAT_ALL_LOGS=1 | |
| else | |
| make check CAT_ALL_LOGS=1 | |
| fi | |
| opam-build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [3.11] | |
| test-location: ['installed', 'local', 'standalone'] | |
| coq-version: ['8.20.0'] | |
| os: ['ubuntu-latest', 'macos-latest'] #, 'windows-latest'] | |
| ocaml-compiler: ['4.14.2'] | |
| env: | |
| OPAMYES: "true" | |
| OPAMCONFIRMLEVEL: "unsafe-yes" | |
| runs-on: ${{ matrix.os }} | |
| name: opam build ${{ matrix.os }} Coq ${{ matrix.coq-version }} Python ${{ matrix.python-version }} OCaml ${{ matrix.ocaml-compiler }} ${{ matrix.test-location }} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.coq-version }}-${{ matrix.python-version }}-${{ matrix.ocaml-compiler }}-${{ matrix.test-location }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Work around https://github.com/ocaml/opam-repository/pull/26891#issuecomment-2486598516 | |
| run: | | |
| # Alternative: brew update; brew upgrade; brew install pkgconf | |
| brew unlink pkg-config | |
| brew install pkgconf | |
| brew unlink pkgconf | |
| brew link pkg-config | |
| if: ${{ runner.os == 'macOS' }} | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up OCaml | |
| uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
| - name: Install dependencies | |
| run: python -m pip install --upgrade pip | |
| - name: Install only dependencies | |
| run: python -m pip install -r requirements.txt | |
| - run: opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev | |
| - run: opam repo add coq-released https://coq.inria.fr/opam/released | |
| - run: opam update | |
| - run: opam pin add ocamlfind --dev-repo | |
| if: runner.os == 'Windows' | |
| - run: opam pin --kind=version add coq ${{ matrix.coq-version }} | |
| - run: python -m pip install flake8 | |
| - run: flake8 coq_tools --count --select=E9,F63,F7,F82 --show-source --statistics | |
| - run: flake8 coq_tools --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| - name: make doctests | |
| run: make doctests PYTHON3=python | |
| if: ${{ matrix.python-version != '2.7' }} | |
| - name: install pytest | |
| run: python -m pip install pytest | |
| - name: make pytest | |
| run: make pytest PYTHON3=python | |
| - name: install package building deps (pip) | |
| run: python -m pip install build wheel twine | |
| if: ${{ matrix.test-location == 'installed' }} | |
| - name: install package building deps (standalone) | |
| run: python -m pip install pyinstaller 'setuptools<71' | |
| if: ${{ matrix.test-location == 'standalone' }} | |
| - name: Build package (dist) | |
| run: make dist | |
| if: ${{ matrix.test-location == 'installed' }} | |
| - name: Build package (standalone) | |
| run: make standalone | |
| if: ${{ matrix.test-location == 'standalone' }} | |
| - name: Test install | |
| run: python -m pip install .[all] | |
| if: ${{ matrix.test-location == 'installed' }} | |
| - run: opam exec -- make print-support | |
| - run: opam exec -- make has-all-tests | |
| - run: opam exec -- make check PYTHON=python CAT_ALL_LOGS=1 | |
| if: ${{ matrix.test-location == 'local' }} | |
| - run: opam exec -- make check PYTHON=python FIND_BUG=coq-bug-minimizer MINIMIZE_REQUIRES=coq-require-minimizer INLINE_IMPORTS=coq-import-inliner CAT_ALL_LOGS=1 | |
| if: ${{ matrix.test-location == 'installed' }} | |
| - run: opam exec -- make check PYTHON=python FIND_BUG=dist/coq-bug-minimizer/coq-bug-minimizer MINIMIZE_REQUIRES=dist/coq-bug-minimizer/coq-require-minimizer INLINE_IMPORTS=dist/coq-bug-minimizer/coq-import-inliner CAT_ALL_LOGS=1 | |
| if: ${{ matrix.test-location == 'standalone' }} | |
| check-all: | |
| runs-on: ubuntu-latest | |
| needs: [build, opam-build] | |
| if: always() | |
| steps: | |
| - run: echo 'The triggering workflow passed' | |
| if: ${{ needs.build.result == 'success' }} | |
| - run: echo 'The triggering workflow failed' && false | |
| if: ${{ needs.build.result != 'success' }} | |
| - run: echo 'The triggering workflow passed (opam)' | |
| if: ${{ needs.opam-build.result == 'success' }} | |
| - run: echo 'The triggering workflow failed (opam)' && false | |
| if: ${{ needs.opam-build.result != 'success' }} |