From af057d9efef30ca5ad1421b57fbf75f2ced4d9a2 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 13:57:38 +0800 Subject: [PATCH 01/12] chore: extract individual test.yml --- .github/workflows/ci.yml | 45 ------------------------------ .github/workflows/test.yml | 57 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b119288186f7..338ae2710865 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,13 +6,6 @@ on: tags: - 'v*' - 'nightly' - pull_request: - branches: ["main" ] - paths: - - 'Cargo.toml' - - 'Cargo.lock' - - 'crates/**' - - 'ee/tabby-webserver/**' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} @@ -24,44 +17,6 @@ env: RUST_TOOLCHAIN: 1.73.0 jobs: - tests: - runs-on: ubuntu-latest - env: - SCCACHE_GHA_ENABLED: true - RUSTC_WRAPPER: sccache - CARGO_INCREMENTAL: 0 - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - - - name: Sccache cache - uses: mozilla-actions/sccache-action@v0.0.3 - with: - version: "v0.4.0" - - - name: Cargo registry cache - uses: actions/cache@v3 - with: - key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-${{ github.sha }} - restore-keys: | - cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}- - cargo-${{ runner.os }}- - path: | - ~/.cargo/registry - ~/.cargo/git - - - run: bash ./ci/prepare_build_environment.sh - - - name: Run unit tests - run: cargo test --bin tabby --lib - - release-binary: if: github.event_name != 'pull_request' needs: tests diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000000..42e2bd70030f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,57 @@ +name: test + +on: + pull_request: + branches: [ "main" ] + paths: + - 'Cargo.toml' + - 'Cargo.lock' + - 'crates/**' + - 'ee/tabby-webserver/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + + # If this is enabled it will cancel current running and start latest + cancel-in-progress: true + +env: + RUST_TOOLCHAIN: 1.73.0 + +jobs: + tests: + runs-on: ubuntu-latest + env: + SCCACHE_GHA_ENABLED: true + RUSTC_WRAPPER: sccache + CARGO_INCREMENTAL: 0 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + + - name: Sccache cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.0" + + - name: Cargo registry cache + uses: actions/cache@v3 + with: + key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-${{ github.sha }} + restore-keys: | + cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}- + cargo-${{ runner.os }}- + path: | + ~/.cargo/registry + ~/.cargo/git + + - run: bash ./ci/prepare_build_environment.sh + + - name: Run unit tests + run: cargo test --bin tabby --lib \ No newline at end of file From 231b2ae26da63dbc9fc5bb7eab445119fc187865 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 13:58:56 +0800 Subject: [PATCH 02/12] update --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 42e2bd70030f..d6903a3425e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,7 @@ on: - 'Cargo.lock' - 'crates/**' - 'ee/tabby-webserver/**' + - '.github/workflows/test.yml' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} From e233e79be25e61d17152be83136b0939d735cbe8 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 13:59:39 +0800 Subject: [PATCH 03/12] update test-intellij --- .../{intellij-test.yml => test-intellij.yml} | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename .github/workflows/{intellij-test.yml => test-intellij.yml} (68%) diff --git a/.github/workflows/intellij-test.yml b/.github/workflows/test-intellij.yml similarity index 68% rename from .github/workflows/intellij-test.yml rename to .github/workflows/test-intellij.yml index fe64b89f3114..d13a1f96efb3 100644 --- a/.github/workflows/intellij-test.yml +++ b/.github/workflows/test-intellij.yml @@ -1,17 +1,18 @@ -name: Test IntelliJ Plugin +name: test on: - push: - branches: [ main ] - paths: - - '.github/workflows/intellij-test.yml' - - 'clients/intellij/**' pull_request: branches: [ main ] paths: - - '.github/workflows/intellij-test.yml' + - '.github/workflows/test-intellij.yml' - 'clients/intellij/**' +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + + # If this is enabled it will cancel current running and start latest + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest From 434e16514d7ea7ba088a779e465926b43f5eb9c9 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 14:01:55 +0800 Subject: [PATCH 04/12] add test-tabby-ui --- .../{tabby-ui-test.yml => test-tabby-ui.yml} | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename .github/workflows/{tabby-ui-test.yml => test-tabby-ui.yml} (74%) diff --git a/.github/workflows/tabby-ui-test.yml b/.github/workflows/test-tabby-ui.yml similarity index 74% rename from .github/workflows/tabby-ui-test.yml rename to .github/workflows/test-tabby-ui.yml index f1f432fa48b9..4a95e9d24939 100644 --- a/.github/workflows/tabby-ui-test.yml +++ b/.github/workflows/test-tabby-ui.yml @@ -1,17 +1,18 @@ -name: Test tabby-ui +name: test on: - push: - branches: [ main ] - paths: - - '.github/workflows/tabby-ui-test.yml' - - 'ee/tabby-ui/**' pull_request: branches: [ main ] paths: - - '.github/workflows/tabby-ui-test.yml' + - '.github/workflows/test-tabby-ui.yml' - 'ee/tabby-ui/**' +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + + # If this is enabled it will cancel current running and start latest + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest From 7a67a01912498129369a189224ca1d3fa3ddbcec Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 14:04:28 +0800 Subject: [PATCH 05/12] update --- .github/workflows/ci.yml | 2 +- .github/workflows/test-intellij.yml | 2 +- .github/workflows/test-tabby-ui.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 338ae2710865..5e0e5912c8ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: - 'nightly' concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + group: ${{ github.workflow_ref }}-${{ github.head_ref || github.ref_name }} # If this is enabled it will cancel current running and start latest cancel-in-progress: true diff --git a/.github/workflows/test-intellij.yml b/.github/workflows/test-intellij.yml index d13a1f96efb3..a1538cad295a 100644 --- a/.github/workflows/test-intellij.yml +++ b/.github/workflows/test-intellij.yml @@ -8,7 +8,7 @@ on: - 'clients/intellij/**' concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + group: ${{ github.workflow_ref }}-${{ github.head_ref || github.ref_name }} # If this is enabled it will cancel current running and start latest cancel-in-progress: true diff --git a/.github/workflows/test-tabby-ui.yml b/.github/workflows/test-tabby-ui.yml index 4a95e9d24939..1b851a89ddc8 100644 --- a/.github/workflows/test-tabby-ui.yml +++ b/.github/workflows/test-tabby-ui.yml @@ -8,7 +8,7 @@ on: - 'ee/tabby-ui/**' concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + group: ${{ github.workflow_ref }}-${{ github.head_ref || github.ref_name }} # If this is enabled it will cancel current running and start latest cancel-in-progress: true From c7e024b3949009d4501972ae60ba28701885a681 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 14:05:45 +0800 Subject: [PATCH 06/12] update --- .github/workflows/test-intellij.yml | 2 +- .github/workflows/test-tabby-ui.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-intellij.yml b/.github/workflows/test-intellij.yml index a1538cad295a..e9b51d2e111f 100644 --- a/.github/workflows/test-intellij.yml +++ b/.github/workflows/test-intellij.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true jobs: - test: + test-intellij: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/test-tabby-ui.yml b/.github/workflows/test-tabby-ui.yml index 1b851a89ddc8..bc1730c96e04 100644 --- a/.github/workflows/test-tabby-ui.yml +++ b/.github/workflows/test-tabby-ui.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true jobs: - test: + test-tabby-ui: runs-on: ubuntu-latest steps: - name: Checkout From 58691b935cc19c531aacdb40756cc333f5fd1296 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 14:06:43 +0800 Subject: [PATCH 07/12] update --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d6903a3425e0..a0f86dd54a74 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ env: RUST_TOOLCHAIN: 1.73.0 jobs: - tests: + test-rust: runs-on: ubuntu-latest env: SCCACHE_GHA_ENABLED: true From 60dcd22a70128f17e1f345d625fc94e563f696df Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 14:09:59 +0800 Subject: [PATCH 08/12] update --- .github/workflows/autofix-python.yml | 2 +- .github/workflows/autofix.yml | 2 +- .github/workflows/{ci.yml => release.yml} | 0 .github/workflows/test-intellij.yml | 4 ++-- .github/workflows/test-tabby-ui.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) rename .github/workflows/{ci.yml => release.yml} (100%) diff --git a/.github/workflows/autofix-python.yml b/.github/workflows/autofix-python.yml index aeaf074387c2..c2872f9a64dc 100644 --- a/.github/workflows/autofix-python.yml +++ b/.github/workflows/autofix-python.yml @@ -10,7 +10,7 @@ permissions: contents: read concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + group: ${{ github.workflow_ref }}-${{ github.head_ref || github.ref_name }} # If this is enabled it will cancel current running and start latest cancel-in-progress: true diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 57177616e2cd..2713fd963327 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -13,7 +13,7 @@ permissions: contents: read concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + group: ${{ github.workflow_ref }}-${{ github.head_ref || github.ref_name }} # If this is enabled it will cancel current running and start latest cancel-in-progress: true diff --git a/.github/workflows/ci.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/release.yml diff --git a/.github/workflows/test-intellij.yml b/.github/workflows/test-intellij.yml index e9b51d2e111f..1ede1ed5c218 100644 --- a/.github/workflows/test-intellij.yml +++ b/.github/workflows/test-intellij.yml @@ -1,4 +1,4 @@ -name: test +name: Test IntelliJ on: pull_request: @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true jobs: - test-intellij: + tests: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/test-tabby-ui.yml b/.github/workflows/test-tabby-ui.yml index bc1730c96e04..75a34fc72c90 100644 --- a/.github/workflows/test-tabby-ui.yml +++ b/.github/workflows/test-tabby-ui.yml @@ -1,4 +1,4 @@ -name: test +name: Test Tabby UI on: pull_request: @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true jobs: - test-tabby-ui: + tests: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0f86dd54a74..dad3a74d9968 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: test +name: Test Rust on: pull_request: @@ -20,7 +20,7 @@ env: RUST_TOOLCHAIN: 1.73.0 jobs: - test-rust: + tests: runs-on: ubuntu-latest env: SCCACHE_GHA_ENABLED: true From f37a57402ee7ae311613a27132bd16177ae0486f Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 14:12:00 +0800 Subject: [PATCH 09/12] update --- .../workflows/{autofix.yml => autofix-rust.yml} | 0 .github/workflows/{test.yml => test-rust.yml} | 0 ...abby-agent-test.yml => test-tabby-agent.yml} | 17 ++++++++--------- .../{vscode-test.yml => test-vscode.yml} | 16 +++++++--------- 4 files changed, 15 insertions(+), 18 deletions(-) rename .github/workflows/{autofix.yml => autofix-rust.yml} (100%) rename .github/workflows/{test.yml => test-rust.yml} (100%) rename .github/workflows/{tabby-agent-test.yml => test-tabby-agent.yml} (79%) rename .github/workflows/{vscode-test.yml => test-vscode.yml} (80%) diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix-rust.yml similarity index 100% rename from .github/workflows/autofix.yml rename to .github/workflows/autofix-rust.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test-rust.yml similarity index 100% rename from .github/workflows/test.yml rename to .github/workflows/test-rust.yml diff --git a/.github/workflows/tabby-agent-test.yml b/.github/workflows/test-tabby-agent.yml similarity index 79% rename from .github/workflows/tabby-agent-test.yml rename to .github/workflows/test-tabby-agent.yml index 9f62fb107ec6..6a3c41974301 100644 --- a/.github/workflows/tabby-agent-test.yml +++ b/.github/workflows/test-tabby-agent.yml @@ -1,13 +1,6 @@ -name: Test tabby-agent +name: Test Tabby Agent on: - push: - branches: [ main ] - paths: - - '.github/workflows/tabby-agent-test.yml' - - 'package.json' - - 'yarn.lock' - - 'clients/tabby-agent/**' pull_request: branches: [ main ] paths: @@ -16,8 +9,14 @@ on: - 'yarn.lock' - 'clients/tabby-agent/**' +concurrency: + group: ${{ github.workflow_ref }}-${{ github.head_ref || github.ref_name }} + + # If this is enabled it will cancel current running and start latest + cancel-in-progress: true + jobs: - test: + tests: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/vscode-test.yml b/.github/workflows/test-vscode.yml similarity index 80% rename from .github/workflows/vscode-test.yml rename to .github/workflows/test-vscode.yml index f581d0e98375..b7f946b67e2f 100644 --- a/.github/workflows/vscode-test.yml +++ b/.github/workflows/test-vscode.yml @@ -1,14 +1,6 @@ name: Test VSCode Extension on: - push: - branches: [ main ] - paths: - - '.github/workflows/vscode-test.yml' - - 'package.json' - - 'yarn.lock' - - 'clients/tabby-agent/**' - - 'clients/vscode/**' pull_request: branches: [ main ] paths: @@ -18,8 +10,14 @@ on: - 'clients/tabby-agent/**' - 'clients/vscode/**' +concurrency: + group: ${{ github.workflow_ref }}-${{ github.head_ref || github.ref_name }} + + # If this is enabled it will cancel current running and start latest + cancel-in-progress: true + jobs: - test: + tests: runs-on: ubuntu-latest steps: - name: Checkout From f99c28bb94747c378272e9f2d8444d08431160ba Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 14:13:11 +0800 Subject: [PATCH 10/12] update --- .github/workflows/test-rust.yml | 2 +- .github/workflows/test-tabby-agent.yml | 2 +- .github/workflows/test-vscode.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-rust.yml b/.github/workflows/test-rust.yml index dad3a74d9968..d74b3daf6af6 100644 --- a/.github/workflows/test-rust.yml +++ b/.github/workflows/test-rust.yml @@ -8,7 +8,7 @@ on: - 'Cargo.lock' - 'crates/**' - 'ee/tabby-webserver/**' - - '.github/workflows/test.yml' + - '.github/workflows/test-rust.yml' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} diff --git a/.github/workflows/test-tabby-agent.yml b/.github/workflows/test-tabby-agent.yml index 6a3c41974301..98573743e49d 100644 --- a/.github/workflows/test-tabby-agent.yml +++ b/.github/workflows/test-tabby-agent.yml @@ -4,7 +4,7 @@ on: pull_request: branches: [ main ] paths: - - '.github/workflows/tabby-agent-test.yml' + - '.github/workflows/test-tabby-agent.yml' - 'package.json' - 'yarn.lock' - 'clients/tabby-agent/**' diff --git a/.github/workflows/test-vscode.yml b/.github/workflows/test-vscode.yml index b7f946b67e2f..6068253dfd5f 100644 --- a/.github/workflows/test-vscode.yml +++ b/.github/workflows/test-vscode.yml @@ -4,7 +4,7 @@ on: pull_request: branches: [ main ] paths: - - '.github/workflows/vscode-test.yml' + - '.github/workflows/test-vscode.yml' - 'package.json' - 'yarn.lock' - 'clients/tabby-agent/**' From 82d95792bcb081c372f3b56ed14472a73322edb3 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 14:14:22 +0800 Subject: [PATCH 11/12] update --- .github/workflows/autofix-python.yml | 1 + .github/workflows/autofix-rust.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/autofix-python.yml b/.github/workflows/autofix-python.yml index c2872f9a64dc..62a77de5dada 100644 --- a/.github/workflows/autofix-python.yml +++ b/.github/workflows/autofix-python.yml @@ -4,6 +4,7 @@ on: pull_request: branches: [ "main" ] paths: + - '.github/workflows/autofix-python.yml' - 'python/**' permissions: diff --git a/.github/workflows/autofix-rust.yml b/.github/workflows/autofix-rust.yml index 2713fd963327..908df6ff1f9f 100644 --- a/.github/workflows/autofix-rust.yml +++ b/.github/workflows/autofix-rust.yml @@ -4,6 +4,7 @@ on: pull_request: branches: ["main" ] paths: + - '.github/workflows/autofix-rust.yml' - 'Cargo.toml' - 'Cargo.lock' - 'crates/**' From 0a876f8400656796b978c1556261083ae1f390b0 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 28 Nov 2023 14:15:40 +0800 Subject: [PATCH 12/12] update --- .github/workflows/{vim-release.yml => release-vim.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{vim-release.yml => release-vim.yml} (100%) diff --git a/.github/workflows/vim-release.yml b/.github/workflows/release-vim.yml similarity index 100% rename from .github/workflows/vim-release.yml rename to .github/workflows/release-vim.yml