Skip to content

Commit

Permalink
End-to-end CLI test
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikvanantwerpen committed Jul 28, 2023
1 parent bcfa9ed commit 3114ca7
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
57 changes: 55 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ on:

jobs:
test-rust:
runs-on: ${{ matrix.os }}
runs-on: ubunut-latest
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]

steps:
Expand Down Expand Up @@ -112,3 +111,57 @@ jobs:
run: cargo build -p ${{ matrix.language }}
- name: Test
run: cargo test -p ${{ matrix.language }}

test-cli:
needs: [test-rust]
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]
env:
TEST_NAME: typeorm-0.3.17

steps:
- name: Install Rust environment
uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo
target
key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-cargo-
- name: Checkout code
uses: actions/checkout@v3
with:
lfs: true
- name: Build
run: cargo build --release -p tree-sitter-stack-graphs-typescript --features cli
- name: Checkout benchmark code
run: unzip benchmarks/${{ env.TEST_NAME }}.zip
- name: Index
run: |
target/release/tree-sitter-stack-graphs-typescript index -D ${{ env.TEST_NAME }}.sqlite --hide-error-details \
${{ env.TEST_NAME }}/package.json \
${{ env.TEST_NAME }}/tsconfig.json \
${{ env.TEST_NAME }}/src/data-source/ \
${{ env.TEST_NAME }}/src/entity-manager/
- name: Index (forced)
run: |
target/release/tree-sitter-stack-graphs-typescript index -D ${{ env.TEST_NAME }}.sqlite --hide-error-details \
${{ env.TEST_NAME }}/package.json \
${{ env.TEST_NAME }}/tsconfig.json \
${{ env.TEST_NAME }}/src/data-source/ \
${{ env.TEST_NAME }}/src/entity-manager/
- name: Query
run: |
target/release/tree-sitter-stack-graphs-typescript query -D ${{ env.TEST_NAME }}.sqlite definition \
src/data-source/DataSource.ts:6:10 \
src/data-source/DataSource.ts:84:23
- name: Query
run: |
target/release/tree-sitter-stack-graphs-typescript status -D ${{ env.TEST_NAME }}.sqlite --all
3 changes: 3 additions & 0 deletions benchmarks/typeorm-0.3.17.zip
Git LFS file not shown

0 comments on commit 3114ca7

Please sign in to comment.