feat: view the result of attested data #78
Workflow file for this run
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: CI | |
| on: | |
| pull_request: | |
| types: [ opened, synchronize, reopened, ready_for_review ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| if: ${{ !github.event.pull_request.draft }} # only run on non-draft PRs | |
| steps: | |
| - name: Checkout sdk-js | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| cache-dependency-path: ./package.json | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| check-latest: true | |
| - name: Install Taskfile | |
| uses: arduino/setup-task@v2 | |
| - name: Checkout trufnetwork/node | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: trufnetwork/node | |
| ref: main | |
| path: tmp-node | |
| - name: Get node commit hash | |
| id: node-commit | |
| working-directory: tmp-node | |
| run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - name: Build tn-db Docker image & kwil-cli binary | |
| run: | | |
| cd tmp-node | |
| task docker:build:local | |
| - name: Cache kwil-cli build | |
| id: cache-kwil-build | |
| if: env.ACT == '' | |
| uses: actions/cache@v4 | |
| with: | |
| path: tmp-node/.build | |
| key: ${{ runner.os }}-kwil-build-${{ steps.node-commit.outputs.sha }} | |
| - name: Build kwil-cli binary | |
| if: steps.cache-kwil-build.outputs.cache-hit != 'true' | |
| run: | | |
| cd tmp-node | |
| task build | |
| - name: Copy kwil-cli binary to path | |
| run: | | |
| sudo cp tmp-node/.build/kwil-cli /usr/local/bin/kwil-cli | |
| # smoke test | |
| kwil-cli version | |
| - name: Pull postgres image | |
| run: docker pull kwildb/postgres:16.8-1 | |
| - name: Install and build sdk-js | |
| run: | | |
| pnpm install | |
| pnpm run build | |
| - name: Run unit tests | |
| run: pnpm test:unit | |
| - name: Run integration tests | |
| run: | | |
| pnpm test:integration | |
| env: | |
| NODE_REPO_DIR: ${{ github.workspace }}/tmp-node | |
| TEST_PRIVATE_KEY: ${{ secrets.TEST_PRIVATE_KEY }} | |
| - name: Cleanup | |
| # not act | |
| if: always() && !env.ACT | |
| run: | | |
| docker system prune -af |