Open v2.1.12 #35
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
| # This workflow groups up the unit tests, the standard node build, and the tests that use the standard node build (integration tests, version upgrade tests) | |
| name: rust-lit-node-group-unit-and-integration-tests | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| enable_version_upgrade_tests: | |
| description: 'Enable version upgrade tests?' | |
| type: boolean | |
| default: false | |
| workflow_call: | |
| push: | |
| paths: | |
| - rust/lit-node/lit-node/** | |
| - .github/workflows/rust-lit-node-integration-tests.yml | |
| - .github/workflows/rust-lit-node-build.yml | |
| - .github/workflows/rust-lit-node-unit-tests.yml | |
| - .github/workflows/rust-lit-node-group-unit-and-integration-tests.yml | |
| - scripts/github/** | |
| branches: | |
| - master | |
| - develop | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_LOG_STYLE: always | |
| RUST_LOG: warn,lit_node=trace,web_user_tests=trace,integration_tests=trace,ecdsa=trace,test=trace | |
| RUST_BACKTRACE: full | |
| LIT_LOGGING_SERVICE_DISABLED: 1 | |
| LIT_CELO_DEPLOYER_PRIVATE_KEY: '0x3178746f7ae6a309d14444b4c6c85a96a4be2f53fa8950dea241d232f3e6c166' | |
| LIT_ALFAJORES_DEPLOYER_PRIVATE_KEY: '0x3178746f7ae6a309d14444b4c6c85a96a4be2f53fa8950dea241d232f3e6c166' | |
| LIT_MUMBAI_DEPLOYER_PRIVATE_KEY: '0x3178746f7ae6a309d14444b4c6c85a96a4be2f53fa8950dea241d232f3e6c166' | |
| LIT_POLYGON_DEPLOYER_PRIVATE_KEY: '0x3178746f7ae6a309d14444b4c6c85a96a4be2f53fa8950dea241d232f3e6c166' | |
| # the above are empty, do not put money in them | |
| IN_GITHUB_CI: 1 | |
| LIT_LOGGING_TIMESTAMP: 1 # force adding timestamp since the CI timestamps are wrong | |
| CARGO_INCREMENTAL: 0 | |
| IPFS_API_KEY: ${{ secrets.IPFS_API_KEY }} | |
| CARGO_NET_GIT_FETCH_WITH_CLI: true | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: rust/lit-node/lit-node | |
| jobs: | |
| # check if we need to build. this is necessary to make this workflow file be able to be run independently of master-trigger, which builds before calling this workflow. for example, on push to a branch, we want to run this workflow without having to run the master-trigger first. | |
| build-if-needed: | |
| uses: ./.github/workflows/rust-lit-node-build-if-needed.yml | |
| with: | |
| build_features: lit-actions,testing | |
| secrets: inherit | |
| # run the unit tests | |
| lit_node_unit_tests: | |
| needs: build-if-needed | |
| runs-on: warp-ubuntu-latest-x64-8x # change to LargeRunner to run on github. Change to self-hosted to run on our own runner. Change to buildjet-8vcpu-ubuntu-2204 to run on buildjet with 8 cpus | |
| timeout-minutes: 30 | |
| services: | |
| anvil: | |
| image: litptcl/anvil-lit:latest | |
| ports: | |
| - 8545:8545 | |
| - 8549:8549 | |
| credentials: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| steps: | |
| - name: Clean workspace | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| rm -rf ../../lit-assets | |
| mkdir -p ${{ github.workspace }} | |
| - name: Install deps | |
| working-directory: ${{ github.workspace }} | |
| run: sudo apt-get update && sudo apt-get install -y libudev-dev libsqlite3-dev cmake protobuf-compiler | |
| - name: Checkout lit-assets | |
| uses: actions/checkout@v6 | |
| - uses: de-vri-es/setup-git-credentials@v2 | |
| with: | |
| credentials: https://glitch003:${{secrets.READ_ONLY_PAT}}@github.com/ | |
| - name: Install rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: '1.91' # keep in sync with rust/lit-node/rust-toolchain.toml | |
| - name: Rust Cache | |
| uses: WarpBuilds/rust-cache@v2 | |
| with: | |
| cache-all-crates: 'false' | |
| workspaces: | | |
| rust/lit-node/lit-node | |
| key: 'cachebuster123' | |
| - name: Install nextest | |
| run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C "${CARGO_HOME:-$HOME/.cargo}/bin" | |
| - name: Setup local files for testing | |
| run: make setup-local-files | |
| - name: Run unit tests (lib and binaries) | |
| run: 'cargo nextest run --final-status-level pass --profile unit-tests --lib --bin lit_node --no-fail-fast --nocapture --' | |
| # after the standard build is done, run the integration tests | |
| lit_node_integration_tests: | |
| needs: build-if-needed | |
| runs-on: warp-ubuntu-latest-x64-8x # change to LargeRunner to run on github. Change to self-hosted to run on our own runner. Change to buildjet-8vcpu-ubuntu-2204 to run on buildjet with 8 cpus | |
| timeout-minutes: 45 | |
| strategy: | |
| matrix: | |
| partition: [1, 2, 3, 4] | |
| services: | |
| anvil: | |
| image: litptcl/anvil-lit:latest | |
| ports: | |
| - 8545:8545 | |
| - 8549:8549 | |
| credentials: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| steps: | |
| - name: Install deps | |
| working-directory: ${{ github.workspace }} | |
| run: sudo apt-get update && sudo apt-get install -y zstd libudev-dev libsqlite3-dev cmake protobuf-compiler | |
| - name: Checkout lit-assets | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: de-vri-es/setup-git-credentials@v2 | |
| with: | |
| credentials: https://glitch003:${{secrets.READ_ONLY_PAT}}@github.com/ | |
| - name: Use Node.js | |
| uses: WarpBuilds/setup-node@v4 | |
| with: | |
| node-version: 18.17.0 | |
| cache: npm | |
| cache-dependency-path: ${{ github.workspace }}/blockchain/contracts/package-lock.json | |
| - name: Install dependencies for blockchain/contracts | |
| working-directory: ${{ github.workspace }}/blockchain/contracts | |
| run: npm install | |
| - name: Run npx hardhat compile for blockchain/contracts | |
| working-directory: ${{ github.workspace }}/blockchain/contracts | |
| run: npx hardhat compile | |
| - run: mkdir -p ~/.cargo/bin | |
| - name: Install nextest | |
| run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C "${CARGO_HOME:-$HOME/.cargo}/bin" | |
| - name: Download archive | |
| uses: WarpBuilds/cache@v1 | |
| with: | |
| path: rust/lit-node/lit-node/nextest-archive.tar.zst | |
| key: nextest-archive-${{ github.sha }}-lit-actions|testing | |
| - name: Unzip archive so that we can get the lit_node binary | |
| run: zstd -d -c nextest-archive.tar.zst | tar xf - | |
| - name: Setup local files for testing | |
| run: make setup-local-files | |
| - name: Run acceptance, component and integration tests. | |
| run: "~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-archive.tar.zst --final-status-level pass --profile integration-tests -E 'test(/^acceptance|^component|^integration|^sdk/) - test(/long/)' --partition count:${{ matrix.partition }}/4 --nocapture --" | |
| # after the standard build is done, run the other integration tests | |
| lit_node_other_tests: | |
| needs: build-if-needed | |
| runs-on: warp-ubuntu-latest-x64-8x # change to LargeRunner to run on github. Change to self-hosted to run on our own runner. Change to buildjet-8vcpu-ubuntu-2204 to run on buildjet with 8 cpus | |
| timeout-minutes: 45 | |
| services: | |
| anvil: | |
| image: litptcl/anvil-lit:latest | |
| ports: | |
| - 8545:8545 | |
| - 8549:8549 | |
| credentials: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| steps: | |
| - name: Install deps | |
| working-directory: ${{ github.workspace }} | |
| run: sudo apt-get update && sudo apt-get install -y zstd libudev-dev libsqlite3-dev cmake protobuf-compiler | |
| - name: Checkout lit-assets | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: de-vri-es/setup-git-credentials@v2 | |
| with: | |
| credentials: https://glitch003:${{secrets.READ_ONLY_PAT}}@github.com/ | |
| - name: Use Node.js | |
| uses: WarpBuilds/setup-node@v4 | |
| with: | |
| node-version: 18.17.0 | |
| cache: npm | |
| cache-dependency-path: ${{ github.workspace }}/blockchain/contracts/package-lock.json | |
| - name: Install dependencies for blockchain/contracts | |
| working-directory: ${{ github.workspace }}/blockchain/contracts | |
| run: npm install | |
| - name: Run npx hardhat compile for blockchain/contracts | |
| working-directory: ${{ github.workspace }}/blockchain/contracts | |
| run: npx hardhat compile | |
| - run: mkdir -p ~/.cargo/bin | |
| - name: Install nextest | |
| run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C "${CARGO_HOME:-$HOME/.cargo}/bin" | |
| - name: Download archive | |
| uses: WarpBuilds/cache@v1 | |
| with: | |
| path: rust/lit-node/lit-node/nextest-archive.tar.zst | |
| key: nextest-archive-${{ github.sha }}-lit-actions|testing | |
| - name: Unzip archive so that we can get the lit_node binary | |
| run: zstd -d -c nextest-archive.tar.zst | tar xf - | |
| - name: Setup local files for testing | |
| run: make setup-local-files | |
| - name: Copy lit-node binary to Shiva target directory | |
| run: | | |
| mkdir -p ${{github.workspace}}/rust/lit-node/shiva/target/debug | |
| cp ${{github.workspace}}/rust/lit-node/lit-node/target/debug/lit_node ${{github.workspace}}/rust/lit-node/shiva/target/debug/lit_node | |
| - name: Run Shiva Integration tests | |
| run: | | |
| mv ${{github.workspace}}/rust/lit-node/lit-node/rpc-config.example.yaml ./rpc-config.yaml | |
| cargo nextest run --final-status-level pass --no-capture -- | |
| working-directory: ${{github.workspace}}/rust/lit-node/shiva | |
| - name: Run acceptance, component and integration tests. | |
| run: "~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-archive.tar.zst --final-status-level pass --profile integration-tests -E 'test(/^edge/) - test(/long/)' --nocapture --" | |
| # AND together the results | |
| check_status: | |
| needs: | |
| [ | |
| lit_node_unit_tests, | |
| lit_node_integration_tests, | |
| lit_node_other_tests, | |
| ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check status | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| if [ ${{ needs.lit_node_unit_tests.result }} != 'success' ]; then | |
| echo "Unit tests failed" | |
| exit 1 | |
| fi | |
| if [ ${{ needs.lit_node_integration_tests.result }} != 'success' ]; then | |
| echo "Integration tests failed" | |
| exit 1 | |
| fi | |
| echo "All tests passed" |