Merge pull request #428 from flatironinstitute/development #2184
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
| name: ci | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: 0 0 1 * * # monthly | |
| pull_request: | |
| branches: | |
| - main | |
| - development | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| tox_tests_not_solver_related: | |
| if: ${{ !github.event.pull_request.draft }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ['3.10', '3.11', '3.12'] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox | |
| - name: Run tox | |
| run: tox -e skip_solver_related | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/[email protected] | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| tox_solver_related_jaxopt_backend: | |
| if: ${{ !github.event.pull_request.draft }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ['3.10', '3.11', '3.12'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 # Use v4 for compatibility with pyproject.toml | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox | |
| - name: Run solver-dependent tests with JAXopt backend | |
| run: tox -e backend-jaxopt | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/[email protected] | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| tox_solver_related_optimistix_backend: | |
| if: ${{ !github.event.pull_request.draft }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ['3.10', '3.11', '3.12'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 # Use v4 for compatibility with pyproject.toml | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox | |
| - name: Run solver-dependent tests with Optimistix backend | |
| run: tox -e backend-optimistix | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/[email protected] | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| tox_check: | |
| if: ${{ !github.event.pull_request.draft }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.12 | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox | |
| - name: Run tox | |
| run: tox -e check | |
| prevent_docs_absolute_links: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Check links | |
| run: ./scripts/prevent_absolute_links_to_docs.sh | |
| check-relative-links: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install markdown-link-check | |
| run: npm install -g markdown-link-check | |
| - name: Check relative links in root Markdown files | |
| run: ./scripts/check_markdown_links.sh relative | |
| check-external-links: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install markdown-link-check | |
| run: npm install -g markdown-link-check | |
| - name: Check external links in root Markdown files | |
| run: ./scripts/check_markdown_links.sh external | |
| check: | |
| if: ${{ !github.event.pull_request.draft }} | |
| needs: | |
| - tox_tests_not_solver_related | |
| - prevent_docs_absolute_links | |
| - tox_check | |
| - check-relative-links | |
| - tox_solver_related_jaxopt_backend | |
| - tox_solver_related_optimistix_backend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Decide whether all tests and notebooks succeeded | |
| uses: re-actors/[email protected] | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| tox_jaxopt: | |
| if: ${{ !github.event.pull_request.draft }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ['3.10', '3.11', '3.12'] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 # Use v4 for compatibility with pyproject.toml | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox | |
| - name: Run tox with JAXopt's tests | |
| run: tox -e jaxopt |