Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: split build job #40

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build installer

on:
workflow_dispatch:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5 # expected run time: <2 min
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
cache-dependency-path: pyproject.toml

- name: install pypa/build
run: pip install --upgrade build

- name: setup frontend
uses: ./.github/actions/install-frontend-deps

- name: create installer
id: create_installer
run: ./create_installer.sh
working-directory: installer

- name: upload python distribution artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: ${{ steps.create_installer.outputs.DIST_PATH }}

- name: upload installer artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.create_installer.outputs.INSTALLER_FILENAME }}
path: ${{ steps.create_installer.outputs.INSTALLER_PATH }}
93 changes: 24 additions & 69 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,9 @@ on:
tags:
- 'v*'
workflow_dispatch:
inputs:
skip_code_checks:
description: 'Skip code checks (disables publish)'
required: true
default: true
type: boolean

jobs:
frontend-checks:
if: github.event.inputs.skip_code_checks != 'true'
runs-on: ubuntu-latest
steps:
- name: run-frontend-checks
uses: ./.github/workflows/frontend-checks.yml

frontend-tests:
if: github.event.inputs.skip_code_checks != 'true'
runs-on: ubuntu-latest
steps:
- name: run-frontend-tests
uses: ./.github/workflows/frontend-tests.yml

python-checks:
if: github.event.inputs.skip_code_checks != 'true'
runs-on: ubuntu-latest
steps:
- name: run-python-checks
uses: ./.github/workflows/python-checks.yml

python-tests:
if: github.event.inputs.skip_code_checks != 'true'
runs-on: ubuntu-latest
steps:
- name: run-python-tests
uses: ./.github/workflows/python-tests.yml

check-version:
if: github.event.inputs.skip_code_checks != 'true'
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -54,45 +19,36 @@ jobs:
with:
version_file_path: invokeai/version/invokeai_version.py

build:
runs-on: ubuntu-latest
timeout-minutes: 15 # expected run time: <10 min
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
cache-dependency-path: pyproject.toml

- name: install pypa/build
run: pip install --upgrade build
frontend-checks:
needs: check-version
uses: ./.github/workflows/frontend-checks.yml

- name: setup frontend
uses: ./.github/actions/install-frontend-deps
frontend-tests:
needs: check-version
uses: ./.github/workflows/frontend-tests.yml

- name: create installer
id: create_installer
run: ./create_installer.sh
working-directory: installer
python-checks:
needs: check-version
uses: ./.github/workflows/python-checks.yml

- name: upload python distribution artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: ${{ steps.create_installer.outputs.DIST_PATH }}
python-tests:
needs: check-version
uses: ./.github/workflows/python-tests.yml

- name: upload installer artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.create_installer.outputs.INSTALLER_FILENAME }}
path: ${{ steps.create_installer.outputs.INSTALLER_PATH }}
build:
needs:
[
check-version,
frontend-checks,
frontend-tests,
python-checks,
python-tests,
]
uses: ./.github/workflows/build.yml

publish-testpypi:
runs-on: ubuntu-latest
timeout-minutes: 5 # expected run time: <1 min
needs:
[
check-version,
Expand All @@ -102,7 +58,6 @@ jobs:
python-tests,
build,
]
if: github.event_name != 'workflow_dispatch'
environment:
name: testpypi
url: https://test.pypi.org/p/invokeai
Expand All @@ -120,6 +75,7 @@ jobs:

publish-pypi:
runs-on: ubuntu-latest
timeout-minutes: 5 # expected run time: <1 min
needs:
[
check-version,
Expand All @@ -129,7 +85,6 @@ jobs:
python-tests,
build,
]
if: github.event_name != 'workflow_dispatch'
environment:
name: pypi
url: https://pypi.org/p/invokeai
Expand Down
Loading