mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
ci: add conditionals for jobs based on dispatch/call
This commit is contained in:
parent
35cd3f6bf0
commit
1ab8565609
13
.github/workflows/frontend-checks.yml
vendored
13
.github/workflows/frontend-checks.yml
vendored
@ -25,6 +25,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: check for changed frontend files
|
- name: check for changed frontend files
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' }}
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v42
|
||||||
with:
|
with:
|
||||||
@ -33,30 +34,30 @@ jobs:
|
|||||||
- 'invokeai/frontend/web/**'
|
- 'invokeai/frontend/web/**'
|
||||||
|
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
uses: ./.github/actions/install-frontend-deps
|
uses: ./.github/actions/install-frontend-deps
|
||||||
|
|
||||||
- name: tsc
|
- name: tsc
|
||||||
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
run: 'pnpm lint:tsc'
|
run: 'pnpm lint:tsc'
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: dpdm
|
- name: dpdm
|
||||||
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
run: 'pnpm lint:dpdm'
|
run: 'pnpm lint:dpdm'
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: eslint
|
- name: eslint
|
||||||
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
run: 'pnpm lint:eslint'
|
run: 'pnpm lint:eslint'
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: prettier
|
- name: prettier
|
||||||
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
run: 'pnpm lint:prettier'
|
run: 'pnpm lint:prettier'
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: knip
|
- name: knip
|
||||||
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
run: 'pnpm lint:knip'
|
run: 'pnpm lint:knip'
|
||||||
shell: bash
|
shell: bash
|
||||||
|
5
.github/workflows/frontend-tests.yml
vendored
5
.github/workflows/frontend-tests.yml
vendored
@ -25,6 +25,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: check for changed frontend files
|
- name: check for changed frontend files
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' }}
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v42
|
||||||
with:
|
with:
|
||||||
@ -33,10 +34,10 @@ jobs:
|
|||||||
- 'invokeai/frontend/web/**'
|
- 'invokeai/frontend/web/**'
|
||||||
|
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
uses: ./.github/actions/install-frontend-deps
|
uses: ./.github/actions/install-frontend-deps
|
||||||
|
|
||||||
- name: vitest
|
- name: vitest
|
||||||
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
run: 'pnpm test:no-watch'
|
run: 'pnpm test:no-watch'
|
||||||
shell: bash
|
shell: bash
|
||||||
|
9
.github/workflows/python-checks.yml
vendored
9
.github/workflows/python-checks.yml
vendored
@ -24,6 +24,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: check for changed python files
|
- name: check for changed python files
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' }}
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v42
|
||||||
with:
|
with:
|
||||||
@ -35,7 +36,7 @@ jobs:
|
|||||||
- 'tests/**'
|
- 'tests/**'
|
||||||
|
|
||||||
- name: setup python
|
- name: setup python
|
||||||
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
@ -43,16 +44,16 @@ jobs:
|
|||||||
cache-dependency-path: pyproject.toml
|
cache-dependency-path: pyproject.toml
|
||||||
|
|
||||||
- name: install ruff
|
- name: install ruff
|
||||||
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
run: pip install ruff
|
run: pip install ruff
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: ruff check
|
- name: ruff check
|
||||||
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
run: ruff check --output-format=github .
|
run: ruff check --output-format=github .
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: ruff format
|
- name: ruff format
|
||||||
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
run: ruff format --check .
|
run: ruff format --check .
|
||||||
shell: bash
|
shell: bash
|
||||||
|
7
.github/workflows/python-tests.yml
vendored
7
.github/workflows/python-tests.yml
vendored
@ -58,6 +58,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: check for changed python files
|
- name: check for changed python files
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'workflow_call' }}
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v42
|
||||||
with:
|
with:
|
||||||
@ -69,7 +70,7 @@ jobs:
|
|||||||
- 'tests/**'
|
- 'tests/**'
|
||||||
|
|
||||||
- name: setup python
|
- name: setup python
|
||||||
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
@ -77,12 +78,12 @@ jobs:
|
|||||||
cache-dependency-path: pyproject.toml
|
cache-dependency-path: pyproject.toml
|
||||||
|
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
env:
|
env:
|
||||||
PIP_EXTRA_INDEX_URL: ${{ matrix.extra-index-url }}
|
PIP_EXTRA_INDEX_URL: ${{ matrix.extra-index-url }}
|
||||||
run: >
|
run: >
|
||||||
pip3 install --editable=".[test]"
|
pip3 install --editable=".[test]"
|
||||||
|
|
||||||
- name: run pytest
|
- name: run pytest
|
||||||
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' }}
|
if: ${{ steps.changed-files.outputs.python_any_changed == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' }}
|
||||||
run: pytest
|
run: pytest
|
||||||
|
Loading…
Reference in New Issue
Block a user