Skip to content

Commit

Permalink
wip workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Dec 17, 2023
1 parent 2274e4c commit dde83f1
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: style checks
name: Check Backend

on:
pull_request:
push:
branches: main
branches: [main]
workflow_call:

jobs:
ruff:
check-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -20,5 +22,8 @@ jobs:
run: |
pip install ruff
- run: ruff check --output-format=github .
- run: ruff format --check .
- name: Ruff check
run: ruff check --output-format=github .

- name: Ruff format
run: ruff format --check .
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint frontend
name: Check Frontend

on:
pull_request:
Expand All @@ -11,33 +11,55 @@ on:
- 'main'
merge_group:
workflow_dispatch:
workflow_call:

defaults:
run:
working-directory: invokeai/frontend/web

jobs:
lint-frontend:
check-frontend:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
steps:
- name: Setup Node 18
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: '8.12.1'
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: 'pnpm install --prefer-frozen-lockfile'

- name: Typescript
run: 'pnpm run lint:tsc'

- name: Madge
run: 'pnpm run lint:madge'

- name: ESLint
run: 'pnpm run lint:eslint'

- name: Prettier
run: 'pnpm run lint:prettier'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test invoke.py pip
name: Run pytest
on:
push:
branches:
Expand Down
32 changes: 29 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,28 @@ name: Release

on:
workflow_dispatch:
inputs:
publish_package:
description: 'Publish build on PyPI [true/false]'
required: true
default: false
type: boolean
skip_env_check:
description: 'Skip tag check [true/false]'
required: true
default: false
type: boolean

jobs:
buildrelease:
check-frontend:
uses: ./.github/workflows/check-frontend.yml
check-backend:
uses: ./.github/workflows/check-backend.yml
pytest:
uses: ./.github/workflows/pytest.yml
release:
runs-on: ubuntu-22.04
needs: [check-frontend, check-backend, pytest]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -34,17 +52,24 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: pip
cache-dependency-path: pyproject.toml

- name: Install frontend dependencies
run: pnpm install --prefer-frozen-lockfile
working-directory: invokeai/frontend/web

- name: Install python dependencies
- name: Install python build dependencies
run: pip install --upgrade build twine

- uses: samuelcolvin/check-python-version@v4
id: check-python-version
with:
skip_env_check: true
skip_env_check: github.event.inputs.skip_env_check
version_file_path: invokeai/version/invokeai_version.py

- name: Run create_installer.sh
Expand All @@ -55,4 +80,5 @@ jobs:
- name: Upload build as workflow artifact
uses: actions/upload-artifact@v4
with:
name: ${{steps.create_installer.outputs.INSTALLER_NAME}}
path: installer/${{steps.create_installer.outputs.INSTALLER_NAME}}
2 changes: 1 addition & 1 deletion installer/create_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ zip -r $FILENAME InvokeAI-Installer
rm -rf InvokeAI-Installer tmp dist ../invokeai/frontend/web/dist/

# Set the output variable for github action
echo "::set-output name=INSTALLER_FILENAME::$FILENAME"
echo "INSTALLER_FILENAME=$FILENAME" >>$GITHUB_OUTPUT

exit 0

0 comments on commit dde83f1

Please sign in to comment.