Feature/lit 2921 js sdk migrate to jest #2943
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Testing | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| - staging/** | |
| - feat/** | |
| - feature/** | |
| jobs: | |
| unit-tests: | |
| runs-on: warp-ubuntu-latest-x64-16x | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: nrwl/nx-set-shas@v3 | |
| with: | |
| main-branch-name: 'master' | |
| - uses: actions/checkout@v3 | |
| - name: Use Node.js | |
| uses: buildjet/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: yarn | |
| cache-dependency-path: ${{ github.workspace }}/yarn.lock | |
| - name: Install Dependencies | |
| run: yarn | |
| - name: Build | |
| run: yarn build:dev | |
| - name: Run Unit tests | |
| run: yarn test:ci | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| DATIL_COMMIT_HASH: ae3c20e07eb933b61073689b95f56867c03de252 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Checkout Lit Actions | |
| uses: actions/checkout@v4 | |
| id: checkout | |
| with: | |
| fetch-depth: 0 | |
| repository: LIT-Protocol/lit-assets | |
| ref: ${{env.DATIL_COMMIT_HASH}} | |
| token: ${{secrets.GH_PAT}} | |
| path: ${{ github.workspace }}/lit-assets/ | |
| submodules: false | |
| sparse-checkout: | | |
| blockchain | |
| rust/lit-node | |
| - name: Check LA dir | |
| run: ls -la ${{github.workspace}}/lit-assets | |
| - name: Setup Lit Bockchain Dependencies | |
| uses: buildjet/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: ${{ github.workspace }}/lit-assets/blockchain/contracts/package-lock.json | |
| - name: Install Blockchain Deps | |
| run: npm i | |
| working-directory: ${{github.workspace}}/lit-assets/blockchain/contracts | |
| - name: Docker login | |
| id: login | |
| run: docker login ghcr.io/ -u ${{secrets.GH_USER}} --password ${{secrets.GH_PAT}} | |
| - name: Pull Shiva Container | |
| id: shiva-pull | |
| run: docker pull ghcr.io/lit-protocol/shiva:latest | |
| - name: Run Shiva Container | |
| id: shiva-runner | |
| run: docker run -d -m 32g -p 8000:8000 -p 8545:8545 -p 7470:7470 -p 7471:7471 -p 7472:7472 -p 7473:7473 -p 7474:7474 -p 7475:7475 -v ${{github.workspace}}/lit-assets:/data -e GH_PAT=${{secrets.GH_PAT}} -e HASH=$DATIL_COMMIT_HASH -e IPFS_API_KEY=${{secrets.IPFS_API_KEY}} --name shiva ghcr.io/lit-protocol/shiva:latest | |
| - name: Install project dependencies | |
| run: yarn | |
| - uses: nrwl/nx-set-shas@v3 | |
| with: | |
| main-branch-name: 'master' | |
| - name: Build packages | |
| id: build | |
| run: yarn build:dev | |
| - name: Copy ENV File | |
| run: cp .env.ci .env | |
| - name: End to End Tests - Connection | |
| id: connection | |
| if: steps.build.outputs.exit_code == 0 | |
| run: yarn test:e2e -t 'Connections' | |
| - name: End Tests Session Compaitiblity | |
| id: session | |
| if: steps.connection.outputs.exit_code == 0 | |
| run: yarn test:e2e -t 'SessionSigs' | |
| - name: End to End Tests - PKP Ethers | |
| if: steps.session.outputs.exit_code == 0 | |
| id: pkp | |
| run: yarn test:e2e -t 'PKP Ethers' | |
| - name: Get Container Logs | |
| if: always() | |
| run: docker logs shiva | |
| - name: Post Pull Shiva Container | |
| id: container-stop | |
| if: steps.shiva-pull.outputs.exit_code == 0 | |
| run: docker stop shiva && docker rm shiva | |