forked from Alzymologist/Kalatori-backend
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Alzymologist#110 from Vovke/force-withdrawal
feat: order force withdrawal
- Loading branch information
Showing
21 changed files
with
471 additions
and
623 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.git | ||
.github | ||
.gitignore | ||
.idea | ||
|
||
chopsticks | ||
docs | ||
target | ||
tests | ||
|
||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Rust test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- stable | ||
|
||
jobs: | ||
check: | ||
name: Cargo test | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout sources | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 50 | ||
submodules: 'recursive' | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/[email protected] | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install cargo-nextest | ||
uses: baptiste0928/cargo-install@v3 | ||
with: | ||
crate: cargo-nextest | ||
version: 0.9 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
|
||
- name: cargo nextest | ||
run: cargo nextest run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Kalatori Tests | ||
name: Kalatori Test | ||
|
||
on: | ||
pull_request: | ||
|
@@ -30,52 +30,28 @@ jobs: | |
- name: Verify directory structure | ||
run: ls -R | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/[email protected] | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install cargo-nextest | ||
uses: baptiste0928/cargo-install@v3 | ||
with: | ||
crate: cargo-nextest | ||
version: 0.9 | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/[email protected] | ||
|
||
- name: Run Rust app in background with environment variables | ||
- name: Install Docker using Docker's official script | ||
run: | | ||
export KALATORI_HOST="127.0.0.1:16726" | ||
export KALATORI_SEED="bottom drive obey lake curtain smoke basket hold race lonely fit walk" | ||
export KALATORI_RECIPIENT="5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" | ||
export KALATORI_REMARK="test" | ||
cargo build | ||
nohup cargo r & | ||
- name: Wait for Rust app to start | ||
run: sleep 120 | ||
# Wait for the Rust app to start and then wait for the app to connect to RPC | ||
curl -fsSL https://get.docker.com -o get-docker.sh | ||
sudo sh get-docker.sh | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install Yarn package manager | ||
run: npm install --global yarn | ||
- name: Install Docker Compose | ||
run: | | ||
sudo curl -L "https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | ||
sudo chmod +x /usr/local/bin/docker-compose | ||
docker-compose --version | ||
- name: Install dependencies | ||
working-directory: ./tests/kalatori-api-test-suite | ||
run: yarn install --network-timeout 100000 | ||
- name: Build and Start Containers | ||
working-directory: ./tests | ||
run: | | ||
docker-compose up -d --build chopsticks-polkadot chopsticks-statemint kalatori-rust-app | ||
- name: Run tests | ||
working-directory: ./tests/kalatori-api-test-suite | ||
env: | ||
DAEMON_HOST: 'http://127.0.0.1:16726' | ||
run: yarn test | ||
- name: Wait for Dependencies to Initialize | ||
run: sleep 60 | ||
|
||
# - name: Run Rust tests | ||
# run: cargo nextest run | ||
- name: Run Tests and Capture Exit Code | ||
working-directory: ./tests | ||
run: | | ||
docker-compose run tests || exit_code=$? | ||
docker-compose down | ||
exit ${exit_code:-0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.