Skip to content

Commit

Permalink
add test projects
Browse files Browse the repository at this point in the history
  • Loading branch information
SwayStar123 committed Sep 13, 2024
1 parent 3fbacb9 commit 08dd656
Show file tree
Hide file tree
Showing 20 changed files with 113 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ jobs:
run: forc build --path ${{ matrix.project }} --release

- name: Run Cargo Tests
run: cargo test
run: cargo test --path ${{ matrix.project }}
28 changes: 18 additions & 10 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,22 @@ env:
REGISTRY: ghcr.io

jobs:
standards-nightly-tests:
examples-nightly-tests:
runs-on: ubuntu-latest

strategy:
matrix:
project:
[
"examples/src3_mint_burn",
"examples/src5_ownership",
"examples/src6_vault",
"examples/src7_metadata",
"examples/src11_security_information",
"examples/src12_contract_factory",
"examples/src14_simple_proxy",
"examples/src20_native_asset",
]

steps:
- name: Checkout repository
Expand Down Expand Up @@ -41,17 +55,11 @@ jobs:
with:
toolchain: nightly

- name: Check Sway Formatting Standards
run: forc fmt --path standards --check

- name: Build All Standards
run: forc build --error-on-warnings --path standards

- name: Check Sway Formatting Examples
run: forc fmt --path examples --check
run: forc fmt --path ${{ matrix.project }} --check

- name: Build All Examples
run: forc build --path examples --release
run: forc build --path ${{ matrix.project }} --release

- name: Run Cargo Tests
run: cargo test
run: cargo test --path ${{ matrix.project }}
3 changes: 0 additions & 3 deletions examples/harness.rs

This file was deleted.

13 changes: 13 additions & 0 deletions examples/src11_security_information/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "src11_security_information"
version = "0.6.1"
edition = "2021"

[[test]]
harness = true
name = "src11_security_information_tests"
path = "tests/harness.rs"

[dependencies]
fuels = { version = "0.66.1" }
tokio = { version = "1.12", features = ["rt", "macros"] }
Empty file.
13 changes: 13 additions & 0 deletions examples/src12_contract_factory/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "src12_contract_factory"
version = "0.6.1"
edition = "2021"

[[test]]
harness = true
name = "src12_contract_factory_tests"
path = "tests/harness.rs"

[dependencies]
fuels = { version = "0.66.1" }
tokio = { version = "1.12", features = ["rt", "macros"] }
Empty file.
6 changes: 3 additions & 3 deletions Cargo.toml → examples/src14_simple_proxy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "sway-standards"
name = "src14_simple_proxy"
version = "0.6.1"
edition = "2021"

[[test]]
harness = true
name = "sway-standards-examples-tests"
path = "examples/harness.rs"
name = "src14_simple_proxy_tests"
path = "tests/harness.rs"

[dependencies]
fuels = { version = "0.66.1" }
Expand Down
Empty file.
13 changes: 13 additions & 0 deletions examples/src20_native_asset/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "src20_native_asset"
version = "0.6.1"
edition = "2021"

[[test]]
harness = true
name = "src20_native_asset_tests"
path = "tests/harness.rs"

[dependencies]
fuels = { version = "0.66.1" }
tokio = { version = "1.12", features = ["rt", "macros"] }
Empty file.
13 changes: 13 additions & 0 deletions examples/src3_mint_burn/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "src3_mint_burn"
version = "0.6.1"
edition = "2021"

[[test]]
harness = true
name = "src3_mint_burn_tests"
path = "tests/harness.rs"

[dependencies]
fuels = { version = "0.66.1" }
tokio = { version = "1.12", features = ["rt", "macros"] }
1 change: 0 additions & 1 deletion examples/src3_mint_burn/mod.rs

This file was deleted.

File renamed without changes.
13 changes: 13 additions & 0 deletions examples/src5_ownership/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "src5_ownership"
version = "0.6.1"
edition = "2021"

[[test]]
harness = true
name = "src5_ownership_tests"
path = "tests/harness.rs"

[dependencies]
fuels = { version = "0.66.1" }
tokio = { version = "1.12", features = ["rt", "macros"] }
Empty file.
13 changes: 13 additions & 0 deletions examples/src6_vault/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "src6_vault"
version = "0.6.1"
edition = "2021"

[[test]]
harness = true
name = "src6_vault_tests"
path = "tests/harness.rs"

[dependencies]
fuels = { version = "0.66.1" }
tokio = { version = "1.12", features = ["rt", "macros"] }
Empty file.
13 changes: 13 additions & 0 deletions examples/src7_metadata/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "src7_metadata"
version = "0.6.1"
edition = "2021"

[[test]]
harness = true
name = "src7_metadata_tests"
path = "tests/harness.rs"

[dependencies]
fuels = { version = "0.66.1" }
tokio = { version = "1.12", features = ["rt", "macros"] }
Empty file.

0 comments on commit 08dd656

Please sign in to comment.