Skip to content

Commit

Permalink
debug workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yomarion committed Sep 15, 2023
1 parent f309e46 commit 63199cb
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 776 deletions.
45 changes: 32 additions & 13 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,39 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Rust version
run: cargo --version
- name: Rust downgrade
run: rustup default 1.67.0
- name: Rust version
run: cargo --version
- uses: actions/checkout@v3
- name: Install wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown
- name: Build and run conversion proxy unit tests
working-directory: ./conversion_proxy
run: cargo test
- name: Build and run fungible proxy unit tests
working-directory: ./fungible_proxy
run: cargo test
- name: Build and run fungible conversion proxy unit tests
working-directory: ./fungible_conversion_proxy
run: cargo test
- name: Build and run mocks unit tests
working-directory: ./mocks
- name: Build contracts and mocks
run: RUSTFLAGS='-C link-arg=-s' cargo build --all --target wasm32-unknown-unknown

# test:
# runs-on: ubuntu-latest
# needs: build
# steps:
# - uses: actions/checkout@v3
# - name: Install wasm32-unknown-unknown target
# run: rustup target add wasm32-unknown-unknown
# - name: fungible proxy unit tests
# run: cargo test -p fungible_proxy
# - name: fungible conversion proxy unit tests
# run: cargo test - fungible_conversion_proxy
- name: Integration tests
run: cargo test
- name: Run integration tests
run: ./test.sh
- name: Unit test - conversion proxy
run: cargo test -p conversion_proxy

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cargo format check
run: cargo fmt -- --check
- name: Cargo clippy
run: cargo clippy -- -D warnings
22 changes: 0 additions & 22 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ hex = "0.4"
[dev-dependencies]
near-sdk-sim = "3.2.0"
conversion_proxy = { path = "./conversion_proxy" }
fungible_conversion_proxy = { path = "./fungible_conversion_proxy" }
fungible_proxy = { path = "./fungible_proxy" }
# fungible_conversion_proxy = { path = "./fungible_conversion_proxy" }
# fungible_proxy = { path = "./fungible_proxy" }
mocks = { path = "./mocks" }

[profile.release]
Expand All @@ -28,4 +28,4 @@ panic = "abort"
overflow-checks = true

[workspace]
members = ["conversion_proxy", "fungible_conversion_proxy", "fungible_proxy", "mocks"]
members = ["conversion_proxy", "mocks"]
2 changes: 0 additions & 2 deletions mocks/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
set -e

RUSTFLAGS='-C link-arg=-s' cargo build --target wasm32-unknown-unknown
mkdir -p ../out
cp ../target/wasm32-unknown-unknown/debug/mocks.wasm ../out/
6 changes: 3 additions & 3 deletions tests/sim/conversion_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ near_sdk::setup_alloc!();

const PROXY_ID: &str = "conversion_proxy";
lazy_static_include::lazy_static_include_bytes! {
PROXY_BYTES => "out/conversion_proxy.wasm"
PROXY_BYTES => "target/wasm32-unknown-unknown/debug/conversion_proxy.wasm"
}
lazy_static_include::lazy_static_include_bytes! {
MOCKED_BYTES => "out/mocks.wasm"
MOCKED_BYTES => "target/wasm32-unknown-unknown/debug/mocks.wasm"
}

const DEFAULT_BALANCE: &str = "400000";
Expand Down Expand Up @@ -60,7 +60,7 @@ fn init() -> (
get_oracle_result.assert_success();

debug_assert_eq!(
&get_oracle_result.unwrap_json_value().to_owned(),
&get_oracle_result.unwrap_json_value(),
&"mockedfpo".to_string()
);

Expand Down
Loading

0 comments on commit 63199cb

Please sign in to comment.