name: pr_test on: workflow_dispatch: pull_request: branches: [main] issue_comment: types: [created] jobs: check-comment: if: ${{ github.event_name == 'issue_comment' && (github.event.comment.body.toLowerCase() == 'run tests' || github.event.comment.body.toLowerCase() == 'run test') && github.event.issue.pull_request }} runs-on: self-hosted outputs: should_run: ${{ steps.check.outputs.should_run }} steps: - id: check run: echo "should_run=true" >> $GITHUB_OUTPUT set-up-test-env: runs-on: self-hosted needs: [check-comment] if: ${{ github.event_name != 'issue_comment' || needs.check-comment.outputs.should_run == 'true' }} steps: - name: Checkout uses: actions/checkout@v4 with: submodules: true - name: Set up Python run: | which python echo "Setting up Python with Conda" conda create -n test_env python=3.11 -y - name: Install dependencies run: | source $(conda info --base)/etc/profile.d/conda.sh conda activate test_env || { echo "Failed to activate conda env"; exit 1; } which python conda install -c conda-forge gxx=11 gcc=11 echo "Installing dependencies" pip install torch torchvision torchaudio pip install ninja wheel diffusers transformers accelerate sentencepiece protobuf huggingface_hub NUNCHAKU_INSTALL_MODE=ALL python setup.py develop pip install -r tests/requirements.txt test-flux-memory: needs: set-up-test-env runs-on: self-hosted timeout-minutes: 30 if: ${{ github.event_name != 'issue_comment' || needs.check-comment.outputs.should_run == 'true' }} steps: - name: Run memory test run: | which python source $(conda info --base)/etc/profile.d/conda.sh conda activate test_env || { echo "Failed to activate conda env"; exit 1; } which python pytest -v -x tests/flux/test_flux_memory.py clean-up: if: always() && (github.event_name != 'issue_comment' || needs.check-comment.outputs.should_run == 'true') needs: [set-up-test-env, test-flux-memory] runs-on: self-hosted steps: - name: Clean up run: | cd .. rm -rf *