From b39029521bc1d0fe983c707e9d111b50db6db394 Mon Sep 17 00:00:00 2001 From: mauwii Date: Sun, 16 Oct 2022 21:50:57 +0200 Subject: [PATCH] use very short validation for Pull Requests --- .github/workflows/test-invoke-conda.yml | 27 +++++++++++++++++-------- tests/pr_prompt.txt | 1 + 2 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 tests/pr_prompt.txt diff --git a/.github/workflows/test-invoke-conda.yml b/.github/workflows/test-invoke-conda.yml index 027d1bce47..adeea0580d 100644 --- a/.github/workflows/test-invoke-conda.yml +++ b/.github/workflows/test-invoke-conda.yml @@ -4,6 +4,10 @@ on: branches: - 'main' - 'development' + pull_request: + branches: + - 'main' + - 'development' jobs: os_matrix: @@ -33,13 +37,20 @@ jobs: auto-update-conda: false miniconda-version: latest - - name: set environment - run: | - [[ "$GITHUB_REF" == 'refs/heads/main' ]] \ - && echo "TEST_PROMPTS=tests/preflight_prompts.txt" >> $GITHUB_ENV \ - || echo "TEST_PROMPTS=tests/dev_prompts.txt" >> $GITHUB_ENV - echo "CONDA_ROOT=$CONDA" >> $GITHUB_ENV - echo "CONDA_ENV_NAME=invokeai" >> $GITHUB_ENV + - name: set test prompt to main branch validation + if: ${{ github.ref == 'refs/heads/main' }} + run: echo "TEST_PROMPTS=tests/preflight_prompts.txt" >> $GITHUB_ENV + + - name: set test prompt to development branch validation + if: ${{ github.ref == 'refs/heads/development' }} + run: echo "TEST_PROMPTS=tests/dev_prompts.txt" >> $GITHUB_ENV + + - name: set test prompt to Pull Request validation + if: ${{ github.ref != "refs/heads/main" && github.ref != 'refs/heads/development' }} + run: echo "TEST_PROMPTS=tests/pr_prompt.txt" >> $GITHUB_ENV + + - name: set conda environment name + run: echo "CONDA_ENV_NAME=invokeai" >> $GITHUB_ENV - name: Use Cached Stable Diffusion v1.4 Model id: cache-sd-v1-4 @@ -65,7 +76,7 @@ jobs: cache-name: cache-conda-env-${{ env.CONDA_ENV_NAME }} conda-env-file: ${{ matrix.environment-file }} with: - path: ${{ env.CONDA_ROOT }}/envs/${{ env.CONDA_ENV_NAME }} + path: ${{ env.CONDA }}/envs/${{ env.CONDA_ENV_NAME }} key: ${{ env.cache-name }} restore-keys: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles(env.conda-env-file) }} diff --git a/tests/pr_prompt.txt b/tests/pr_prompt.txt new file mode 100644 index 0000000000..c1a8e00cbe --- /dev/null +++ b/tests/pr_prompt.txt @@ -0,0 +1 @@ +banana sushi -Ak_lms -S42 -s10