|
| 1 | +name: ci-casper-js-client |
| 2 | +on: |
| 3 | + # Allows you to run this workflow manually from the Actions tab |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + - develop |
| 9 | + paths-ignore: |
| 10 | + - "**.md" |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - master |
| 14 | + - develop |
| 15 | + - feature/* |
| 16 | + paths-ignore: |
| 17 | + - "**.md" |
| 18 | + |
| 19 | +env: |
| 20 | + NODE_ENV: ci |
| 21 | + WASM_RELEASE_PATH: ${{ github.workspace }}/target/wasm32-unknown-unknown/release |
| 22 | + NCTL_USERS_FOLDER_PATH: /tmp/net-1/users |
| 23 | + CHAIN_NAME: casper-net-1 |
| 24 | + NODE_ADDRESS: http://localhost:11101/rpc |
| 25 | + EVENT_STREAM_ADDRESS: http://localhost:18101/events/main |
| 26 | + INSTALL_PAYMENT_AMOUNT: 200000000000 |
| 27 | + DEPLOY_PAYMENT_AMOUNT: 200000000000 |
| 28 | + |
| 29 | +jobs: |
| 30 | + run-e2e: |
| 31 | + # The type of runner that the job will run on |
| 32 | + runs-on: ubuntu-latest |
| 33 | + # Service containers to run with `runner-job` |
| 34 | + services: |
| 35 | + # Label used to access the service container |
| 36 | + casper-nctl: |
| 37 | + # Docker Hub image |
| 38 | + image: makesoftware/casper-nctl:v144-220303 |
| 39 | + options: --name casper-nctl # -v ${{ github.workspace }}/assets:/home/casper/casper-node/utils/nctl/assets |
| 40 | + env: |
| 41 | + PREDEFINED_ACCOUNTS: 'true' |
| 42 | + MINIMUM_ROUND_EXPONENT: '12' |
| 43 | + MAXIMUM_ROUND_EXPONENT: '13' |
| 44 | + DEPLOY_DELAY: '2sec' |
| 45 | + ports: |
| 46 | + # Opens RPC, REST and events ports on the host and service container |
| 47 | + - 11101:11101 |
| 48 | + - 14101:14101 |
| 49 | + - 18101:18101 |
| 50 | + volumes: |
| 51 | + - /tmp:/home/casper/casper-node/utils/nctl/assets |
| 52 | + steps: |
| 53 | + - name: Fix keys permission |
| 54 | + run: sudo chown runner $NCTL_USERS_FOLDER_PATH/*/* |
| 55 | + |
| 56 | + - name: Checkout |
| 57 | + uses: actions/checkout@v2 |
| 58 | + |
| 59 | + - name: Cache Build Wasm |
| 60 | + id: wasm-cache |
| 61 | + uses: actions/cache@v1 |
| 62 | + with: |
| 63 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 64 | + restore-keys: ${{ runner.os }}-cargo- |
| 65 | + path: | |
| 66 | + /home/runner/.cargo/bin |
| 67 | + /home/runner/.cargo/git |
| 68 | + /home/runner/.cargo/registry/cache |
| 69 | + /home/runner/.cargo/registry/index |
| 70 | + target |
| 71 | +
|
| 72 | + - name: Build Wasm |
| 73 | + if: steps.wasm-cache.outputs.cache-hit != 'true' |
| 74 | + uses: actions-rs/toolchain@v1 |
| 75 | + with: |
| 76 | + toolchain: stable |
| 77 | + profile: minimal |
| 78 | + components: rustfmt, clippy |
| 79 | + - run: sudo apt update && sudo apt install -y build-essential && sudo apt-get install wabt |
| 80 | + if: steps.wasm-cache.outputs.cache-hit != 'true' |
| 81 | + - run: make prepare |
| 82 | + if: steps.wasm-cache.outputs.cache-hit != 'true' |
| 83 | + - run: make build-contracts |
| 84 | + if: steps.wasm-cache.outputs.cache-hit != 'true' |
| 85 | + |
| 86 | + - name: Setup NodeJS |
| 87 | + uses: actions/setup-node@v2 |
| 88 | + with: |
| 89 | + node-version: "14" |
| 90 | + |
| 91 | + - name: Npm Install |
| 92 | + run: cd client && npm install |
| 93 | + |
| 94 | + - name: E2E Test Report - Reputation Contract Client |
| 95 | + run: cd client && NODE_ENV=ci npm run e2e:reputation |
0 commit comments