From afff3df03d50b17c9ecc0bfe68ba69afe7e8bc64 Mon Sep 17 00:00:00 2001 From: Gabriela Moreira Date: Thu, 4 Apr 2024 15:55:35 -0300 Subject: [PATCH 1/7] Create github action --- .github/workflows/rust.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..ce04c40 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,28 @@ +name: Rust + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Install nightly toolchain with clippy available + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: clippy, rust-src, rustc-dev, llvm-tools-preview + target: wasm32-unknown-unknown + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose From 11a0d8ade8ae13469a664307c9df216306fdcb02 Mon Sep 17 00:00:00 2001 From: bugarela Date: Thu, 4 Apr 2024 16:02:18 -0300 Subject: [PATCH 2/7] Update toolchain and workflow name --- .github/workflows/{rust.yml => main.yml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{rust.yml => main.yml} (76%) diff --git a/.github/workflows/rust.yml b/.github/workflows/main.yml similarity index 76% rename from .github/workflows/rust.yml rename to .github/workflows/main.yml index ce04c40..d419083 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Rust +name: cosmwasm-to-quint on: push: @@ -10,15 +10,15 @@ env: CARGO_TERM_COLOR: always jobs: - build: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install nightly toolchain with clippy available + - name: Install nightly toolchain with rustc components and wasm target uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: nightly-2024-01-06 override: true components: clippy, rust-src, rustc-dev, llvm-tools-preview target: wasm32-unknown-unknown From 60380c209ee5b15c958a086822688c2514a8a35d Mon Sep 17 00:00:00 2001 From: bugarela Date: Thu, 4 Apr 2024 16:08:32 -0300 Subject: [PATCH 3/7] Print command to debug CI --- tests/integration_tests.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 86ca255..bc92e57 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -37,7 +37,8 @@ fn run(dir: &str, f: impl FnOnce(&mut Command)) -> Result { let _ = fs::remove_dir_all(ws.join("target")); - let output = cmd.output().context("Process failed AA")?; + println!("Running {:?}", cmd); + let output = cmd.output().context("Process failed")?; ensure!( output.status.success(), "Process exited with non-zero exit code. Stderr:\n{}", @@ -47,8 +48,6 @@ fn run(dir: &str, f: impl FnOnce(&mut Command)) -> Result { Ok(String::from_utf8(output.stdout)?) } -// TODO: why do these tests need to be run sequentially? - #[test] fn ctf01() -> Result<()> { let output = run("cosmwasm-ctf/ctf-01", |_cmd| {})?; From 657d779fba1f261ffda461e0a2e9936680d894c2 Mon Sep 17 00:00:00 2001 From: bugarela Date: Thu, 4 Apr 2024 16:36:12 -0300 Subject: [PATCH 4/7] Run tests with cargo-insta --- .github/workflows/main.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d419083..cbf3222 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,12 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: actions-rs/install@v0.1 + with: + crate: cargo-insta + version: latest + use-tool-cache: true + - name: Install nightly toolchain with rustc components and wasm target uses: actions-rs/toolchain@v1 with: @@ -22,7 +28,13 @@ jobs: override: true components: clippy, rust-src, rustc-dev, llvm-tools-preview target: wasm32-unknown-unknown - - name: Build - run: cargo build --verbose + + - name: Install cosmwasm-to-quint + run: cargo install --path . --debug --locked + shell: bash + - name: Run tests - run: cargo test --verbose + uses: actions-rs/cargo@v1 + with: + command: insta + args: test From bcfe528c4b7074f0f8e2367ed7ca9d289081f772 Mon Sep 17 00:00:00 2001 From: bugarela Date: Thu, 4 Apr 2024 16:42:12 -0300 Subject: [PATCH 5/7] Add submodules option to action checkout --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cbf3222..370da3c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + submodules: 'recursive' - uses: actions-rs/install@v0.1 with: crate: cargo-insta From 18dfa1a6665ef92aac7deb6b14c8843a388a0a96 Mon Sep 17 00:00:00 2001 From: bugarela Date: Thu, 4 Apr 2024 16:52:16 -0300 Subject: [PATCH 6/7] Remove debug line --- tests/integration_tests.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index bc92e57..a7d3579 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -37,7 +37,6 @@ fn run(dir: &str, f: impl FnOnce(&mut Command)) -> Result { let _ = fs::remove_dir_all(ws.join("target")); - println!("Running {:?}", cmd); let output = cmd.output().context("Process failed")?; ensure!( output.status.success(), From e6fbe0d6c22c6e221368618091592377fa251da5 Mon Sep 17 00:00:00 2001 From: bugarela Date: Thu, 4 Apr 2024 16:54:31 -0300 Subject: [PATCH 7/7] Fix formatting --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 370da3c..042f8f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' + - uses: actions-rs/install@v0.1 with: crate: cargo-insta