Skip to content

Commit

Permalink
seperate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Foivos committed Jul 4, 2024
1 parent fb4bb73 commit 48816cd
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 3 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/test-js.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Javascript Tests

on:
pull_request:
push:
branches:
- main
- releases/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
SUI_VERSION: mainnet-v1.25.3

jobs:
test-js:
runs-on: ubuntu-latest

steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev
- name: Cache Sui binaries
id: cache-sui
uses: actions/cache/restore@v4
with:
path: sui-binaries-skip/
key: sui-${{ env.SUI_VERSION }}

- name: Download and Install Sui
if: steps.cache-sui.outputs.cache-hit != 'true'
run: |
curl -L -o sui-${SUI_VERSION}-ubuntu-x86_64.tgz https://github.com/MystenLabs/sui/releases/download/${SUI_VERSION}/sui-${SUI_VERSION}-ubuntu-x86_64.tgz
tar -xvf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
mkdir -p sui-binaries
mv ./sui ./sui-binaries/
mv ./sui-debug ./sui-binaries/
mv ./sui-test-validator ./sui-binaries/
rm -rf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
- name: Save Sui binaries
if: steps.cache-sui.outputs.cache-hit != 'true'
id: cache-sui-save
uses: actions/cache/save@v4
with:
path: sui-binaries/
key: ${{ steps.cache-sui.outputs.cache-primary-key }}

- name: Add Sui binaries to PATH
run: |
sudo cp ./sui-binaries/sui /usr/local/bin/sui
sudo cp ./sui-binaries/sui-debug /usr/local/bin/sui-debug
sudo cp ./sui-binaries/sui-test-validator /usr/local/bin/sui-test-validator
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Run Localnet
run: nohup sh -c "sui-test-validator" > nohup.out 2> nohup.err < /dev/null &

- name: Sleep for 30 seconds
run: sleep 30s
shell: bash

- name: Test
run: npm run test-js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Move Tests

on:
pull_request:
Expand All @@ -15,7 +15,7 @@ env:
SUI_VERSION: mainnet-v1.25.3

jobs:
test:
test-move:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -70,4 +70,4 @@ jobs:
run: npm run build

- name: Test
run: npm run test
run: npm run test-move

0 comments on commit 48816cd

Please sign in to comment.