Skip to content

Commit

Permalink
chore: improve gh actions and package.json (#22)
Browse files Browse the repository at this point in the history
* chore: cleanup gitignore

* ci: improve test gh action

* chore: cleanup package.json

* fix package lock

* reorder ci

* fix lint errors
  • Loading branch information
milapsheth authored Apr 23, 2024
1 parent 39f710b commit 0781411
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conventional-commits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- name: semantic-pull-request
uses: amannn/action-semantic-pull-request@v3.2.6
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
36 changes: 16 additions & 20 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,36 @@ name: Run Tests

on: pull_request

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

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
arch: [amd64]
runs-on: ubuntu-latest

steps:
- name: Setup Dependencies for Sui Binary
run: sudo apt-get update && sudo apt-get install -y libpq-dev

- name: Download and Install Sui Binary
env:
SUI_VERSION: mainnet-v1.22.0
run: |
wget https://github.com/MystenLabs/sui/releases/download/mainnet-v1.22.0/sui-mainnet-v1.22.0-ubuntu-x86_64.tgz
tar -xvf sui-mainnet-v1.22.0-ubuntu-x86_64.tgz
wget 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
sudo mv ./target/release/sui-test-validator-ubuntu-x86_64 /usr/local/bin/sui-test-validator
sudo mv ./target/release/sui-ubuntu-x86_64 /usr/local/bin/sui
- name: Cleanup
run: rm -rf sui-mainnet-v1.22.0-ubuntu-x86_64.tgz

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
rm -rf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache node_modules
uses: actions/cache@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm ci
Expand Down
60 changes: 55 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,57 @@
node_modules
### Mac OS ###

.DS_STORE

### Move ###

move/**/build
.env
Move.lock
info
.DS_STORE
target

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Coverage directory used by tools like istanbul
coverage
*.lcov

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

### Rust ###
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
6 changes: 1 addition & 5 deletions move/interchain_token/sources/interchain_token.move
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
module interchain_token::b {
use sui::tx_context::{Self, TxContext};
use std::option;

use sui::coin::{Self};
use sui::url::{Url};
use sui::transfer;

public struct B has drop {}

Expand All @@ -21,4 +17,4 @@ module interchain_token::b {
transfer::public_transfer(treasury, tx_context::sender(ctx));
transfer::public_transfer(metadata, tx_context::sender(ctx));
}
}
}
15 changes: 2 additions & 13 deletions move/trading/sources/test/trading.move
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module trading::trading {
);
balances(this, pool);
}

public fun swap_base<T1, T2>(this: &mut Storage<T1, T2>, pool: &mut Pool<T1, T2>, quantity: u64, clock: &Clock, ctx: &mut TxContext) {
let (base_coin, quote_coin, _) = pool.swap_exact_base_for_quote(
0,
Expand Down Expand Up @@ -104,15 +104,4 @@ module trading::trading {
quote_locked,
});
}

#[test]
fun test() {
let ctx = &mut tx_context.dummy();
clob::create_pool(
100,
100,
coin,
ctx,
);
}
}
}
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
{
"name": "@axelar-network/axelar-cgp-sui",
"version": "0.0.0",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/axelarnetwork/axelar-cgp-sui"
},
"main": "index.js",
"main": "index.js",
"scripts": {
"build": "",
"test": "npm run test:abi & npm run test:axelar & npm run test:governance & npm run test:gas_service & npm run test:its",
"test:abi": "sui move test --path ./move/abi",
"test:axelar": "sui move test --path ./move/axelar",
"test:governance": "sui move test --path ./move/governance",
"test:gas_service": "sui move test --path ./move/gas_service",
"test:its": "sui move test --path ./move/its"
"build": "for d in ./move/*/; do cd $d; sui move build --lint --warnings-are-errors; cd ../../; done",
"test": "for d in ./move/*/; do sui move test --path $d; done"
},
"keywords": [
"axelar",
Expand All @@ -22,7 +17,7 @@
"author": "axelar-network",
"license": "MIT",
"engines": {
"node": ">=16"
"node": ">=18"
},
"dependencies": {
"@mysten/sui.js": "^0.47.0",
Expand Down

0 comments on commit 0781411

Please sign in to comment.