Commit 84df0933 authored by muyangli's avatar muyangli
Browse files

switch to manual trigger to avoid malicious codes

parent 396772e2
name: pr_test_linux
on:
workflow_dispatch: # launch manually for now since there is no sandbox.
workflow_dispatch:
inputs:
test_target:
description: 'What to test: "pr" or "branch"'
required: true
type: choice
options:
- pr
- branch
pr_number:
description: 'Pull Request Number (only if test_target == "pr")'
required: false
branch_name:
description: 'Branch name (only if test_target == "branch")'
default: 'main'
required: false
# push:
# branches: [ main ]
# paths:
......@@ -47,10 +64,19 @@ jobs:
if: ${{ github.event_name != 'issue_comment' || needs.check-comment.outputs.should_run == 'true' }}
steps:
- name: Determine ref
id: set-ref
run: |
if [[ "${{ github.event.inputs.test_target }}" == "pr" ]]; then
echo "ref=refs/pull/${{ github.event.inputs.pr_number }}/merge" >> $GITHUB_OUTPUT
else
echo "ref=refs/heads/${{ github.event.inputs.branch_name }}" >> $GITHUB_OUTPUT
fi
- name: Checkout
uses: actions/checkout@v4
with:
# ref: ${{ github.event.pull_request.head.sha || github.sha }}
ref: ${{ steps.set-ref.outputs.ref }}
submodules: true
- name: Show current commit
......@@ -102,7 +128,7 @@ jobs:
source $(conda info --base)/etc/profile.d/conda.sh
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
which python
NUNCHAKU_TEST_CACHE_ROOT=${{ secrets.NUNCHAKU_TEST_CACHE_ROOT }} HF_TOKEN=${{ secrets.HF_TOKEN }} pytest -v tests/flux/test_flux_memory.py
NUNCHAKU_TEST_CACHE_ROOT=${{ secrets.NUNCHAKU_TEST_CACHE_ROOT_LINUX }} HF_TOKEN=${{ secrets.HF_TOKEN }} pytest -v tests/flux/test_flux_memory.py
test-flux-other:
needs: build
......@@ -117,7 +143,7 @@ jobs:
source $(conda info --base)/etc/profile.d/conda.sh
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
which python
NUNCHAKU_TEST_CACHE_ROOT=${{ secrets.NUNCHAKU_TEST_CACHE_ROOT }} HF_TOKEN=${{ secrets.HF_TOKEN }} pytest -v tests/flux --ignore=tests/flux/test_flux_memory.py
NUNCHAKU_TEST_CACHE_ROOT=${{ secrets.NUNCHAKU_TEST_CACHE_ROOT_LINUX }} HF_TOKEN=${{ secrets.HF_TOKEN }} pytest -v tests/flux --ignore=tests/flux/test_flux_memory.py
test-sana:
needs: build
......@@ -132,7 +158,7 @@ jobs:
source $(conda info --base)/etc/profile.d/conda.sh
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
which python
NUNCHAKU_TEST_CACHE_ROOT=${{ secrets.NUNCHAKU_TEST_CACHE_ROOT }} HF_TOKEN=${{ secrets.HF_TOKEN }} pytest -v tests/sana
NUNCHAKU_TEST_CACHE_ROOT=${{ secrets.NUNCHAKU_TEST_CACHE_ROOT_LINUX }} HF_TOKEN=${{ secrets.HF_TOKEN }} pytest -v tests/sana
clean-up:
if: always() && (github.event_name != 'issue_comment' || needs.check-comment.outputs.should_run == 'true')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment