diff --git a/.github/workflows/js-tests.yml b/.github/workflows/js-tests.yml index 90408d8..e4a56c5 100644 --- a/.github/workflows/js-tests.yml +++ b/.github/workflows/js-tests.yml @@ -1,4 +1,4 @@ -name: JS Unit Tests +name: JS CI on: workflow_dispatch: @@ -7,19 +7,16 @@ on: paths: - logflare-js/** - - defaults: run: - working-directory: apps/logflare_js/priv - + working-directory: logflare-js jobs: - build: + unit_tests: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x, 18.x] + node-version: [16.x, 18.x, 20.x] steps: - uses: actions/checkout@v2 @@ -27,7 +24,38 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Restore caches + uses: actions/cache/restore@v3 + with: + path: | + logflare-js/node_modules + key: ${{ runner.os }}-${{matrix.node-version }}-npm + - run: npm ci + # use experiemntal node option for 16.x + - run: NODE_OPTIONS=--experimental-fetch npm run test + if: matrix.node-version == '16.x' + - run: npm run test + if: matrix.node-version != '16.x' + + build_check: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x, 18.x, 20.x] + + steps: + - uses: actions/checkout@v2 + - name: Setup node ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Restore caches + uses: actions/cache/restore@v3 + with: + path: | + logflare-js/node_modules + key: ${{ runner.os }}-${{matrix.node-version }}-npm - name: Install deps run: npm ci - name: Build - run: npm run test \ No newline at end of file + run: npm run build diff --git a/logflare-js/package-lock.json b/logflare-js/package-lock.json index 18aef62..6518960 100644 --- a/logflare-js/package-lock.json +++ b/logflare-js/package-lock.json @@ -1,11 +1,11 @@ { - "name": "logflare-js", + "name": "@logflare/logflare-js", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "logflare-js", + "name": "@logflare/logflare-js", "version": "0.1.0", "license": "MIT", "devDependencies": { diff --git a/logflare-js/package.json b/logflare-js/package.json index 7a6c497..2058dce 100644 --- a/logflare-js/package.json +++ b/logflare-js/package.json @@ -1,5 +1,5 @@ { - "name": "logflare-js", + "name": "@logflare/logflare-js", "version": "0.1.0", "description": "Logflare JS SDK", "scripts": {