diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e88562d..b4dbe22 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -120,4 +120,4 @@ jobs: run: forc build --path ${{ matrix.project }} --release - name: Run Cargo Tests - run: cargo test \ No newline at end of file + run: cargo test --path ${{ matrix.project }} \ No newline at end of file diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 657839b..24a5065 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -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 @@ -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 \ No newline at end of file + run: cargo test --path ${{ matrix.project }} \ No newline at end of file diff --git a/examples/harness.rs b/examples/harness.rs deleted file mode 100644 index 2a6c90a..0000000 --- a/examples/harness.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod src3_mint_burn; - -fn main() {} diff --git a/examples/src11_security_information/Cargo.toml b/examples/src11_security_information/Cargo.toml new file mode 100644 index 0000000..2579e15 --- /dev/null +++ b/examples/src11_security_information/Cargo.toml @@ -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"] } \ No newline at end of file diff --git a/examples/src11_security_information/tests/harness.rs b/examples/src11_security_information/tests/harness.rs new file mode 100644 index 0000000..e69de29 diff --git a/examples/src12_contract_factory/Cargo.toml b/examples/src12_contract_factory/Cargo.toml new file mode 100644 index 0000000..99320d9 --- /dev/null +++ b/examples/src12_contract_factory/Cargo.toml @@ -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"] } \ No newline at end of file diff --git a/examples/src12_contract_factory/tests/harness.rs b/examples/src12_contract_factory/tests/harness.rs new file mode 100644 index 0000000..e69de29 diff --git a/Cargo.toml b/examples/src14_simple_proxy/Cargo.toml similarity index 65% rename from Cargo.toml rename to examples/src14_simple_proxy/Cargo.toml index a10039a..6c585d4 100644 --- a/Cargo.toml +++ b/examples/src14_simple_proxy/Cargo.toml @@ -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" } diff --git a/examples/src14_simple_proxy/tests/harness.rs b/examples/src14_simple_proxy/tests/harness.rs new file mode 100644 index 0000000..e69de29 diff --git a/examples/src20_native_asset/Cargo.toml b/examples/src20_native_asset/Cargo.toml new file mode 100644 index 0000000..9026bb0 --- /dev/null +++ b/examples/src20_native_asset/Cargo.toml @@ -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"] } \ No newline at end of file diff --git a/examples/src20_native_asset/tests/harness.rs b/examples/src20_native_asset/tests/harness.rs new file mode 100644 index 0000000..e69de29 diff --git a/examples/src3_mint_burn/Cargo.toml b/examples/src3_mint_burn/Cargo.toml new file mode 100644 index 0000000..7903b91 --- /dev/null +++ b/examples/src3_mint_burn/Cargo.toml @@ -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"] } \ No newline at end of file diff --git a/examples/src3_mint_burn/mod.rs b/examples/src3_mint_burn/mod.rs deleted file mode 100644 index 14f0038..0000000 --- a/examples/src3_mint_burn/mod.rs +++ /dev/null @@ -1 +0,0 @@ -mod tests; diff --git a/examples/src3_mint_burn/tests/mod.rs b/examples/src3_mint_burn/tests/harness.rs similarity index 100% rename from examples/src3_mint_burn/tests/mod.rs rename to examples/src3_mint_burn/tests/harness.rs diff --git a/examples/src5_ownership/Cargo.toml b/examples/src5_ownership/Cargo.toml new file mode 100644 index 0000000..db88a64 --- /dev/null +++ b/examples/src5_ownership/Cargo.toml @@ -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"] } \ No newline at end of file diff --git a/examples/src5_ownership/tests/harness.rs b/examples/src5_ownership/tests/harness.rs new file mode 100644 index 0000000..e69de29 diff --git a/examples/src6_vault/Cargo.toml b/examples/src6_vault/Cargo.toml new file mode 100644 index 0000000..7a40949 --- /dev/null +++ b/examples/src6_vault/Cargo.toml @@ -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"] } \ No newline at end of file diff --git a/examples/src6_vault/tests/harness.rs b/examples/src6_vault/tests/harness.rs new file mode 100644 index 0000000..e69de29 diff --git a/examples/src7_metadata/Cargo.toml b/examples/src7_metadata/Cargo.toml new file mode 100644 index 0000000..bd36af2 --- /dev/null +++ b/examples/src7_metadata/Cargo.toml @@ -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"] } \ No newline at end of file diff --git a/examples/src7_metadata/tests/harness.rs b/examples/src7_metadata/tests/harness.rs new file mode 100644 index 0000000..e69de29