From 90f90a2201ee03d49b25f4f713d1cfff0a39b869 Mon Sep 17 00:00:00 2001 From: David Corvoysier Date: Tue, 14 Nov 2023 14:41:50 +0000 Subject: [PATCH] chore: run all tests when setup.py is modified --- .github/workflows/check_code_quality.yml | 2 ++ .github/workflows/test_common.yml | 4 +++- .github/workflows/test_inf1.yml | 4 +++- .github/workflows/test_inf2.yml | 2 ++ .github/workflows/test_trainium_common.yml | 4 +++- .github/workflows/test_trainium_distributed.yml | 6 ++++-- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check_code_quality.yml b/.github/workflows/check_code_quality.yml index 88fd4ca84..de139d476 100644 --- a/.github/workflows/check_code_quality.yml +++ b/.github/workflows/check_code_quality.yml @@ -4,6 +4,7 @@ on: push: branches: [ main ] paths: + - "setup.py" - "optimum/neuron/**.py" - "tests/**.py" - "examples/**.py" @@ -11,6 +12,7 @@ on: pull_request: branches: [ main ] paths: + - "setup.py" - "optimum/neuron/**.py" - "tests/**.py" - "examples/**.py" diff --git a/.github/workflows/test_common.yml b/.github/workflows/test_common.yml index f900a3b7c..ac270c7eb 100644 --- a/.github/workflows/test_common.yml +++ b/.github/workflows/test_common.yml @@ -6,14 +6,16 @@ on: push: branches: [ main ] paths: + - "setup.py" - "optimum/neuron/**.py" - "tests/**.py" - "examples/**.py" - "tools/**.py" - + pull_request: branches: [ main ] paths: + - "setup.py" - "optimum/neuron/**.py" - "tests/**.py" - "examples/**.py" diff --git a/.github/workflows/test_inf1.yml b/.github/workflows/test_inf1.yml index 7f2602ca8..6acfa2f90 100644 --- a/.github/workflows/test_inf1.yml +++ b/.github/workflows/test_inf1.yml @@ -4,10 +4,12 @@ on: push: branches: [ main ] paths: + - "setup.py" - "optimum/**.py" pull_request: branches: [ main ] paths: + - "setup.py" - "optimum/**.py" concurrency: @@ -26,7 +28,7 @@ jobs: - name: Install python dependencies run: | sudo apt install python3.8-venv -y - python3 -m venv aws_neuron_venv_pytorch + python3 -m venv aws_neuron_venv_pytorch source aws_neuron_venv_pytorch/bin/activate python -m pip install -U pip python -m pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com diff --git a/.github/workflows/test_inf2.yml b/.github/workflows/test_inf2.yml index 473820ff0..b778bcae8 100644 --- a/.github/workflows/test_inf2.yml +++ b/.github/workflows/test_inf2.yml @@ -4,10 +4,12 @@ on: push: branches: [ main ] paths: + - "setup.py" - "optimum/**.py" pull_request: branches: [ main ] paths: + - "setup.py" - "optimum/**.py" concurrency: diff --git a/.github/workflows/test_trainium_common.yml b/.github/workflows/test_trainium_common.yml index 8e0682afd..b06bd5bce 100644 --- a/.github/workflows/test_trainium_common.yml +++ b/.github/workflows/test_trainium_common.yml @@ -4,10 +4,12 @@ on: push: branches: [ main ] paths: + - "setup.py" - "optimum/**.py" pull_request: branches: [ main ] paths: + - "setup.py" - "optimum/**.py" concurrency: @@ -35,5 +37,5 @@ jobs: - name: Run tests on Neuron cores run: | HF_TOKEN_OPTIMUM_NEURON_CI=${{ secrets.HF_TOKEN_OPTIMUM_NEURON_CI }} USE_VENV="false" pytest -m "is_trainium_test" $TESTS_TO_IGNORE_FLAGS tests - - name: Run staging tests on Neuron cores + - name: Run staging tests on Neuron cores run: HUGGINGFACE_CO_STAGING=1 pytest -m "is_trainium_test and is_staging_test" $TESTS_TO_IGNORE_FLAGS tests -s diff --git a/.github/workflows/test_trainium_distributed.yml b/.github/workflows/test_trainium_distributed.yml index 61f965919..2c9f039a6 100644 --- a/.github/workflows/test_trainium_distributed.yml +++ b/.github/workflows/test_trainium_distributed.yml @@ -4,10 +4,12 @@ on: push: branches: [ main ] paths: + - "setup.py" - "optimum/neuron/distributed/**.py" pull_request: branches: [ main ] paths: + - "setup.py" - "optimum/neuron/distributed/**.py" concurrency: @@ -17,7 +19,7 @@ concurrency: jobs: optimum-neuron-tests: - runs-on: [self-hosted, 16-aws-trn, 128-cpu, ci] + runs-on: [self-hosted, 16-aws-trn, 128-cpu, ci] env: AWS_REGION: us-east-1 steps: @@ -32,4 +34,4 @@ jobs: - name: Run tests on Neuron cores run: | HF_TOKEN_OPTIMUM_NEURON_CI=${{ secrets.HF_TOKEN_OPTIMUM_NEURON_CI }} pytest -m "is_trainium_test" tests/distributed/ - +