forked from MystenLabs/sui
/
action.yml
68 lines (59 loc) · 2.71 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Detect Changes in Turbo Workspace
description: Run e2e tests with specified branch
inputs:
ref:
description: 'The branch to checkout and run e2e tests on'
required: true
runs:
using: composite
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
with:
ref: ${{ inputs.ref }}
# Disabled for now as it makes test runs take longer
# - uses: bmwill/rust-cache@v1 # Fork of 'Swatinem/rust-cache' which allows caching additional paths
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # pin@v3.0.0
with:
version: 9.1.1
- name: Check s3 if binaries have been uploaded already
continue-on-error: true
id: check_s3
run: |
echo "Checking if s3 binaries have been built for ${{ github.sha }}"
echo "s3_file_exist=$(curl -Is https://sui-releases.s3.us-east-1.amazonaws.com/${{ github.sha }}/debug/sui-test-validator | head -n 1 | grep '200 OK')" >> $GITHUB_ENV
shell: bash
- name: cargo build
if: env.s3_file_exist == '' # if empty, we have not built and uploaded this binary to s3 yet
run: |
cargo build --bin sui-test-validator --bin sui
shell: bash
- name: Dowload from S3
if: env.s3_file_exist != '' # only download if the s3 file exists
working-directory: ./target/debug
run: |
mkdir -p $PWD/target/debug
wget -O target/debug/sui-test-validator https://sui-releases.s3.us-east-1.amazonaws.com/${{ github.sha }}/debug/sui-test-validator
chmod +x $PWD/target/debug/sui-test-validator
wget -O target/debug/sui-test-validator https://sui-releases.s3.us-east-1.amazonaws.com/${{ github.sha }}/debug/sui
chmod +x $PWD/target/debug/sui
shell: bash
# checkout current branch
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
with:
clean: false
- name: Install Nodejs
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin@v4.0.2
with:
node-version: '18'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
shell: bash
- name: Set env
run: |
echo "E2E_RUN_LOCAL_NET_CMD=(RUST_LOG=\"consensus=off\" $(echo $PWD/target/debug/sui-test-validator) --with-indexer --pg-port 5432 --pg-db-name sui_indexer_v2 --graphql-host 127.0.0.1 --graphql-port 9125)" >> $GITHUB_ENV
echo "VITE_SUI_BIN=$PWD/target/debug/sui" >> $GITHUB_ENV
shell: bash
- name: Run TS SDK e2e tests
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @mysten/sui.js --filter @mysten/graphql-transport test:e2e'
shell: bash