diff --git a/.github/workflows/autofix-python.yml b/.github/workflows/autofix-python.yml index aeaf074387c2..62a77de5dada 100644 --- a/.github/workflows/autofix-python.yml +++ b/.github/workflows/autofix-python.yml @@ -4,13 +4,14 @@ on: pull_request: branches: [ "main" ] paths: + - '.github/workflows/autofix-python.yml' - 'python/**' 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-rust.yml similarity index 91% rename from .github/workflows/autofix.yml rename to .github/workflows/autofix-rust.yml index 57177616e2cd..908df6ff1f9f 100644 --- a/.github/workflows/autofix.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/**' @@ -13,7 +14,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/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 diff --git a/.github/workflows/ci.yml b/.github/workflows/release.yml similarity index 71% rename from .github/workflows/ci.yml rename to .github/workflows/release.yml index b119288186f7..5e0e5912c8ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/release.yml @@ -6,16 +6,9 @@ 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 }} + 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 @@ -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/intellij-test.yml b/.github/workflows/test-intellij.yml similarity index 65% rename from .github/workflows/intellij-test.yml rename to .github/workflows/test-intellij.yml index fe64b89f3114..1ede1ed5c218 100644 --- a/.github/workflows/intellij-test.yml +++ b/.github/workflows/test-intellij.yml @@ -1,19 +1,20 @@ -name: Test IntelliJ Plugin +name: Test IntelliJ 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_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/test-rust.yml b/.github/workflows/test-rust.yml new file mode 100644 index 000000000000..d74b3daf6af6 --- /dev/null +++ b/.github/workflows/test-rust.yml @@ -0,0 +1,58 @@ +name: Test Rust + +on: + pull_request: + branches: [ "main" ] + paths: + - 'Cargo.toml' + - 'Cargo.lock' + - 'crates/**' + - 'ee/tabby-webserver/**' + - '.github/workflows/test-rust.yml' + +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 diff --git a/.github/workflows/tabby-agent-test.yml b/.github/workflows/test-tabby-agent.yml similarity index 75% rename from .github/workflows/tabby-agent-test.yml rename to .github/workflows/test-tabby-agent.yml index 9f62fb107ec6..98573743e49d 100644 --- a/.github/workflows/tabby-agent-test.yml +++ b/.github/workflows/test-tabby-agent.yml @@ -1,23 +1,22 @@ -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: - - '.github/workflows/tabby-agent-test.yml' + - '.github/workflows/test-tabby-agent.yml' - 'package.json' - '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/tabby-ui-test.yml b/.github/workflows/test-tabby-ui.yml similarity index 73% rename from .github/workflows/tabby-ui-test.yml rename to .github/workflows/test-tabby-ui.yml index f1f432fa48b9..75a34fc72c90 100644 --- a/.github/workflows/tabby-ui-test.yml +++ b/.github/workflows/test-tabby-ui.yml @@ -1,19 +1,20 @@ -name: Test tabby-ui +name: Test Tabby UI 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_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 76% rename from .github/workflows/vscode-test.yml rename to .github/workflows/test-vscode.yml index f581d0e98375..6068253dfd5f 100644 --- a/.github/workflows/vscode-test.yml +++ b/.github/workflows/test-vscode.yml @@ -1,25 +1,23 @@ 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: - - '.github/workflows/vscode-test.yml' + - '.github/workflows/test-vscode.yml' - 'package.json' - 'yarn.lock' - '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