From 7f5fb4637a2ea1bd025cebc794b5d0be32529355 Mon Sep 17 00:00:00 2001 From: Dimo99 Date: Thu, 29 Jun 2023 17:23:40 +0300 Subject: [PATCH] feat(ci): Split all tests to different jobs --- .github/actions/setup/action.yml | 23 +++++ .github/workflows/ci.yml | 163 +++++++++++++++++++++---------- 2 files changed, 136 insertions(+), 50 deletions(-) create mode 100644 .github/actions/setup/action.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 000000000..53db1db64 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,23 @@ +name: 'Common Setup Steps' +description: 'Checks out the repo and installs dependencies' +inputs: + cachix_auth_token: + description: 'Cachix Cache Authentication Token' + required: true +runs: + using: "composite" + steps: + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v4 + - name: Run the Magic Nix Cache + uses: DeterminateSystems/magic-nix-cache-action@v1 + - uses: cachix/cachix-action@v12 + with: + name: nix-blockchain-development + authToken: '${{ inputs.cachix_auth_token }}' + - name: Build Nix dev shell + shell: bash + run: ./scripts/build-nix-shell.sh + - name: Install Node.js dependencies + shell: bash + run: nix develop -c yarn install --immutable diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df9a5fecc..c2298076b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,109 +14,172 @@ env: ETHERSCAN_API_KEY: '${{ secrets.ETHERSCAN_API_KEY }}' jobs: - Tests: + EOS_Relayer_Test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: recursive - - uses: cachix/install-nix-action@v20 + - name: Use local my-action + uses: ./.github/actions/setup with: - nix_path: nixpkgs=channel:nixos-22.11 - install_url: https://releases.nixos.org/nix/nix-2.15.0/install + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - uses: cachix/cachix-action@v12 - with: - name: nix-blockchain-development - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - - name: Build Nix dev shell - run: ./scripts/build-nix-shell.sh + - name: Run Verifier in EOS - Relayer test + run: nix develop -c yarn test './tests/eosLightClient/test-verifier-in-EOS-relay.ts' - - name: Install Node.js dependencies - run: nix develop -c yarn install --immutable + Solidity_Validators_Accumulator_Test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: + uses: ./.github/actions/setup + with: + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - name: Install Node.js dependencies - run: nix develop -c yarn format:check + - name: Run Solidity Validators accumulator tests + run: nix develop -c make test-validator-accumulator - - name: Run Verifier in EOS - Relayer test - run: nix develop -c yarn test './tests/eosLightClient/test-verifier-in-EOS-relay.ts' + Nim_Light_Client_Compiled_with_Emsctipten_Tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Use local my-action + uses: ./.github/actions/setup + with: + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Run Nim Light Client compiled with emsctipten tests run: nix develop -c yarn test-emcc './tests/test-nim-to-wasm.ts' 'test-nim-light-client.ts' + Nim_Light_Client_Clang_Test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Use local my-action + uses: ./.github/actions/setup + with: + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Run Nim Light Client compiled with clang tests run: nix develop -c yarn test './tests/test-nim-to-wasm.ts' 'test-nim-light-client.ts' + Nim_Groth16_Verifier_Tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Use local my-action + uses: ./.github/actions/setup + with: + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Run Nim groth16 verifier tests run: nix develop -c make test-groth16-verifier + Run_Light_Client_In_Cosmos_Test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Use local my-action + uses: ./.github/actions/setup + with: + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Run Light Client in Cosmos test run: nix develop -c yarn test './tests/cosmosLightClient/test-nim-light-client-in-cosmos.ts' + Run_Verifier_In_Cosmos_Test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Use local my-action + uses: ./.github/actions/setup + with: + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Run Verifier in Cosmos test run: nix develop -c yarn test './tests/cosmosLightClient/test-verifier-in-cosmos.ts' + Run_Circom_Tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Use local my-action + uses: ./.github/actions/setup + with: + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Run circom tests run: nix develop -c make test-circom-circuits + Run_Verifier_In_Cosmos_Relay_Tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Use local my-action + uses: ./.github/actions/setup + with: + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Run Verifier in Cosmos - Relayer test run: nix develop -c yarn test './tests/cosmosLightClient/test-verifier-in-cosmos-relay.ts' - - name: Run Solidity Validators accumulator tests - run: nix develop -c make test-validator-accumulator - - # - name: Run Verifier in EOS test - # run: nix develop -c yarn test './tests/eosLightClient/test-verifier-in-EOS.ts' + Run_Verify_Given_Proof: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Use local my-action + uses: ./.github/actions/setup + with: + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Run Verify given proof - test using bncurve and constantine run: nix develop -c nim c -r 'tests/verify_proof/verify_given_proof_test.nim' - SolidityVerifierTests: - needs: Tests + Solidity_Verifier_Tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: recursive - - - uses: cachix/install-nix-action@v20 - with: - nix_path: nixpkgs=channel:nixos-22.11 - install_url: https://releases.nixos.org/nix/nix-2.15.0/install - - - uses: cachix/cachix-action@v12 + - name: Use local my-action + uses: ./.github/actions/setup with: - name: nix-blockchain-development - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - - name: Install Node.js dependencies - run: nix develop -c yarn install --immutable + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Run Solidity verifier tests run: nix develop -c make evm-simulation - OneShotSyncingSimulation: - needs: Tests + OneShot_Syncing_Simulation: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: submodules: recursive - - - uses: cachix/install-nix-action@v20 + - name: Use local my-action + uses: ./.github/actions/setup with: - nix_path: nixpkgs=channel:nixos-22.11 - install_url: https://releases.nixos.org/nix/nix-2.15.0/install - - - uses: cachix/cachix-action@v12 - with: - name: nix-blockchain-development - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - - name: Install Node.js dependencies - run: nix develop -c yarn install --immutable + cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Run one shot syncing simulation run: nix develop -c make one-shot-syncing-simulation