From edb40e2f2ca246d1818af8c326b02a09bb14859a Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 14 Sep 2023 22:59:28 -0400 Subject: [PATCH 1/7] run e2e tests after all other checks have passed --- .github/workflows/e2e.yml | 12 +++++++++++- .github/workflows/pre-commit.yml | 1 + .github/workflows/tests.yml | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 09c26c2a6..c5845127e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,10 +1,12 @@ name: E2E on: + pull_request: workflow_dispatch: jobs: e2e-test: - runs-on: [self-hosted, gpu] + name: E2E Tests + runs-on: [self-hosted, gpu, e2e] strategy: fail-fast: false matrix: @@ -12,6 +14,14 @@ jobs: timeout-minutes: 10 steps: + - name: Wait for pytest and pre-commit to succeed + uses: lewagon/wait-on-check-action@v1.3.1 + with: + ref: ${{ github.ref }} + running-workflow-name: 'E2E Tests' + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 10 + - name: Check out repository code uses: actions/checkout@v3 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 626edc686..b5bc49578 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -6,6 +6,7 @@ on: jobs: pre-commit: + name: pre-commit runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a2ee39262..8227b48b8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,6 +5,7 @@ on: jobs: test: + name: PyTest runs-on: ubuntu-latest strategy: fail-fast: false From f2c8b5008fc920517fde03eaacc9f865bdde2c10 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 14 Sep 2023 23:01:48 -0400 Subject: [PATCH 2/7] tweak tests so they get run on PRs or push to main --- .github/workflows/e2e.yml | 4 ++++ .github/workflows/pre-commit.yml | 2 ++ .github/workflows/tests.yml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c5845127e..6fd5a75ec 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,5 +1,9 @@ name: E2E on: + # check on push/merge to main, PRs, and manual triggers + push: + branches: + - "main" pull_request: workflow_dispatch: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index b5bc49578..7b8ccd01c 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -3,6 +3,8 @@ name: pre-commit on: pull_request: push: + branches: + - "main" jobs: pre-commit: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8227b48b8..cb292d426 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,8 @@ name: PyTest on: push: + branches: + - "main" pull_request: jobs: From d8fa022c8de451a4430feeb1cc2994fcc720416b Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 14 Sep 2023 23:12:58 -0400 Subject: [PATCH 3/7] change dependent action for chcecking --- .github/workflows/e2e.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 6fd5a75ec..5890a7335 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -15,16 +15,19 @@ jobs: fail-fast: false matrix: python_version: ["3.10"] - timeout-minutes: 10 + timeout-minutes: 20 + permissions: + actions: read steps: - name: Wait for pytest and pre-commit to succeed - uses: lewagon/wait-on-check-action@v1.3.1 + uses: yogeshlonkar/wait-for-jobs@v0 with: ref: ${{ github.ref }} - running-workflow-name: 'E2E Tests' - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 10 + jobs: 'pre-commit,pre-commit' + gh-token: ${{ secrets.GITHUB_TOKEN }} + interval: 60000 + ttl: '15' - name: Check out repository code uses: actions/checkout@v3 From 79196eba98e80fe6593327dabcd19fa92a59df53 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 14 Sep 2023 23:39:25 -0400 Subject: [PATCH 4/7] one test workflow to rule them all --- .github/workflows/e2e.yml | 49 --------------------------- .github/workflows/pre-commit.yml | 19 ----------- .github/workflows/tests.yml | 57 ++++++++++++++++++++++++++++++-- 3 files changed, 55 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/e2e.yml delete mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index 5890a7335..000000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: E2E -on: - # check on push/merge to main, PRs, and manual triggers - push: - branches: - - "main" - pull_request: - workflow_dispatch: - -jobs: - e2e-test: - name: E2E Tests - runs-on: [self-hosted, gpu, e2e] - strategy: - fail-fast: false - matrix: - python_version: ["3.10"] - timeout-minutes: 20 - permissions: - actions: read - - steps: - - name: Wait for pytest and pre-commit to succeed - uses: yogeshlonkar/wait-for-jobs@v0 - with: - ref: ${{ github.ref }} - jobs: 'pre-commit,pre-commit' - gh-token: ${{ secrets.GITHUB_TOKEN }} - interval: 60000 - ttl: '15' - - - name: Check out repository code - uses: actions/checkout@v3 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python_version }} - cache: 'pip' # caching pip dependencies - - - name: Install dependencies - run: | - pip3 install -e . - pip3 install flash-attn - pip3 install -r requirements-tests.txt - - - name: Run e2e tests - run: | - pytest tests/e2e/ diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index 7b8ccd01c..000000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - branches: - - "main" - -jobs: - pre-commit: - name: pre-commit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.9" - cache: 'pip' # caching pip dependencies - - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cb292d426..a35bb92e3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,12 +1,25 @@ -name: PyTest +name: Tests on: + # check on push/merge to main, PRs, and manual triggers push: branches: - "main" pull_request: + workflow_dispatch: jobs: - test: + pre-commit: + name: pre-commit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.9" + cache: 'pip' # caching pip dependencies + - uses: pre-commit/action@v3.0.0 + + pytest: name: PyTest runs-on: ubuntu-latest strategy: @@ -33,3 +46,43 @@ jobs: - name: Run tests run: | pytest --ignore=tests/e2e/ tests/ + + e2e-test: + name: E2E Tests + runs-on: [self-hosted, gpu, e2e] + strategy: + fail-fast: false + matrix: + python_version: ["3.10"] + timeout-minutes: 20 + permissions: + actions: read + + steps: + - name: Wait for pytest and pre-commit to succeed + uses: yogeshlonkar/wait-for-jobs@v0 + with: + ref: ${{ github.ref }} + jobs: 'pre-commit,PyTest' + gh-token: ${{ secrets.GITHUB_TOKEN }} + interval: 60000 + ttl: '15' + + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python_version }} + cache: 'pip' # caching pip dependencies + + - name: Install dependencies + run: | + pip3 install -e . + pip3 install flash-attn + pip3 install -r requirements-tests.txt + + - name: Run e2e tests + run: | + pytest tests/e2e/ From 8097874edde94e7eff1666dbd59fd85b5724e60b Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 14 Sep 2023 23:46:01 -0400 Subject: [PATCH 5/7] no need for custom action, just use needs --- .github/workflows/tests.yml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a35bb92e3..818efc28e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,31 +50,17 @@ jobs: e2e-test: name: E2E Tests runs-on: [self-hosted, gpu, e2e] - strategy: - fail-fast: false - matrix: - python_version: ["3.10"] timeout-minutes: 20 - permissions: - actions: read + needs: [pre-commit, pytest] steps: - - name: Wait for pytest and pre-commit to succeed - uses: yogeshlonkar/wait-for-jobs@v0 - with: - ref: ${{ github.ref }} - jobs: 'pre-commit,PyTest' - gh-token: ${{ secrets.GITHUB_TOKEN }} - interval: 60000 - ttl: '15' - - name: Check out repository code uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python_version }} + python-version: 3.10 cache: 'pip' # caching pip dependencies - name: Install dependencies From a82b89fd5989f83d7b3dcb16ec75e1b14a652e57 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Thu, 14 Sep 2023 23:51:55 -0400 Subject: [PATCH 6/7] whoops, python version should be a string --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 818efc28e..78b87c032 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -60,7 +60,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: 3.10 + python-version: "3.10" cache: 'pip' # caching pip dependencies - name: Install dependencies From e88f33b1283bdcbcbe0b2e9e007dad4614338947 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Fri, 15 Sep 2023 00:44:27 -0400 Subject: [PATCH 7/7] e2e tests can run on any available gpu --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 78b87c032..017c1b1b6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,7 +49,7 @@ jobs: e2e-test: name: E2E Tests - runs-on: [self-hosted, gpu, e2e] + runs-on: [self-hosted, gpu] timeout-minutes: 20 needs: [pre-commit, pytest]