Allow workflow_dispatch trigger for CI job #1607
Workflow file for this run
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': | |
| pull_request: null | |
| workflow_dispatch: null | |
| concurrency: | |
| group: '${{ github.workflow }}-${{ github.ref }}' | |
| cancel-in-progress: true | |
| jobs: | |
| detect-ci-trigger: | |
| name: detect ci trigger | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' | |
| outputs: | |
| triggered: '${{ steps.detect-trigger.outputs.trigger-found }}' | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| with: | |
| fetch-depth: 2 | |
| - uses: julia-actions/setup-julia@v2.6.1 | |
| with: | |
| version: '1.10' | |
| - uses: xarray-contrib/ci-trigger@v1.2.1 | |
| id: detect-trigger | |
| with: | |
| keyword: '[skip-ci]' | |
| test: | |
| name: pytest on Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| needs: detect-ci-trigger | |
| if: needs.detect-ci-trigger.outputs.triggered == 'false' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - '3.13' | |
| - '3.12' | |
| - '3.11' | |
| - '3.10' | |
| defaults: | |
| run: | |
| shell: 'bash -l {0}' | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: julia-actions/setup-julia@v2.6.1 | |
| with: | |
| version: '1.10' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6.3.1 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| cache-dependency-glob: "**/pyproject.toml" | |
| - name: List installed dependencies | |
| run: | | |
| uv sync --group test | |
| uv pip list | |
| - name: Run tests | |
| run: uv run --group test pytest tests | |
| doctest: | |
| name: doctests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: 'bash -l {0}' | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: julia-actions/setup-julia@v2.6.1 | |
| with: | |
| version: '1.10' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6.3.1 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "**/pyproject.toml" | |
| - name: Run doctests | |
| run: | | |
| uv run --group test python -m pytest --doctest-modules xbitinfo --ignore xbitinfo/tests | |
| test_notebooks: | |
| name: notebooks | |
| runs-on: ubuntu-latest | |
| needs: detect-ci-trigger | |
| if: needs.detect-ci-trigger.outputs.triggered == 'false' | |
| defaults: | |
| run: | |
| shell: 'bash -l {0}' | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - uses: julia-actions/setup-julia@v2.6.1 | |
| with: | |
| version: '1.10' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6.3.1 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "**/pyproject.toml" | |
| - name: Test notebooks | |
| run: > | |
| uv run --group docs python -m ipykernel install --user --name bitinfo-docs | |
| uv run --group docs jupyter nbconvert --to html --execute docs/*.ipynb | |
| --ExecutePreprocessor.kernel_name=bitinfo-docs | |
| install: | |
| name: 'install xbitinfo, ${{ matrix.os }}' | |
| runs-on: '${{ matrix.os }}' | |
| needs: detect-ci-trigger | |
| if: needs.detect-ci-trigger.outputs.triggered == 'false' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup python | |
| uses: actions/setup-python@v5.6.0 | |
| with: | |
| python-version: '3.11' | |
| - name: Set up Julia | |
| uses: julia-actions/setup-julia@v2.6.1 | |
| with: | |
| version: '1.10' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6.3.1 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "**/pyproject.toml" | |
| - name: Smoketest | |
| run: | | |
| uv run python -c "import xbitinfo" |