From 224441203f3e953b4e5f7878153d3cd086e00659 Mon Sep 17 00:00:00 2001 From: ASuciuX Date: Mon, 18 Dec 2023 19:10:22 +0200 Subject: [PATCH] feat: add workflows and rename files --- .github/workflows/filter-pr-mutants.yml | 22 +++++++++++++++++ .github/workflows/logger-mutants.yml | 28 ++++++++++++++++++++++ clarity/Cargo.toml | 2 +- clarity/src/{libclarity.rs => lib.rs} | 0 libsigner/Cargo.toml | 2 +- libsigner/src/{libsigner.rs => lib.rs} | 0 stacks-common/Cargo.toml | 2 +- stacks-common/src/{libcommon.rs => lib.rs} | 0 8 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/filter-pr-mutants.yml create mode 100644 .github/workflows/logger-mutants.yml rename clarity/src/{libclarity.rs => lib.rs} (100%) rename libsigner/src/{libsigner.rs => lib.rs} (100%) rename stacks-common/src/{libcommon.rs => lib.rs} (100%) diff --git a/.github/workflows/filter-pr-mutants.yml b/.github/workflows/filter-pr-mutants.yml new file mode 100644 index 0000000000..9f3870540c --- /dev/null +++ b/.github/workflows/filter-pr-mutants.yml @@ -0,0 +1,22 @@ +name: Tracking PR Mutants + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + paths: + - "**.rs" + +jobs: + # Mutants testing: Execute on PR on packages that have functions modified, and fail the workflow if there are missed or timeout mutations + incremental-mutants: + name: Incremental Mutants Testing + + runs-on: ubuntu-latest + + steps: + - name: Run filtering pr mutants from actions + uses: ASuciuX/actions/mutation-testing/filter-pr@test/simulate-pr-and-merged-mutants diff --git a/.github/workflows/logger-mutants.yml b/.github/workflows/logger-mutants.yml new file mode 100644 index 0000000000..8069e4aeaf --- /dev/null +++ b/.github/workflows/logger-mutants.yml @@ -0,0 +1,28 @@ +name: Logging Mutants + +# only run on push in order to update the cache output +# flow: +# restore cache +# install cargo-mutants crate in order to run the 'cargo mutants' command +# create a file with the current commit hash if a previous one doesn't exist, then print it +# run the script that handles the 'cargo mutants' command on the differences between the latest updates and the last commit where it was ran +# overwrite the previous commit hash with the current one for the following run +# delete the old cache +# save the new cache with the updated mutants +# upload artifact to easily check it for the given commit + +on: + push: + branches: + - deployer/simulate-mutants-on-pr-and-merge + +jobs: + save_cache: + runs-on: ubuntu-latest + + # test + steps: + - name: Run logging mutants from actions + uses: ASuciuX/actions/mutation-testing/logger@test/simulate-pr-and-merged-mutants + with: + gh-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/clarity/Cargo.toml b/clarity/Cargo.toml index 86089991dc..e83c77f823 100644 --- a/clarity/Cargo.toml +++ b/clarity/Cargo.toml @@ -15,7 +15,7 @@ resolver = "2" [lib] name = "clarity" -path = "./src/libclarity.rs" +path = "./src/lib.rs" [dependencies] rand = "0.7.3" diff --git a/clarity/src/libclarity.rs b/clarity/src/lib.rs similarity index 100% rename from clarity/src/libclarity.rs rename to clarity/src/lib.rs diff --git a/libsigner/Cargo.toml b/libsigner/Cargo.toml index 8500ef55fa..35aaca69f7 100644 --- a/libsigner/Cargo.toml +++ b/libsigner/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" [lib] name = "libsigner" -path = "./src/libsigner.rs" +path = "./src/lib.rs" [dependencies] clarity = { path = "../clarity" } diff --git a/libsigner/src/libsigner.rs b/libsigner/src/lib.rs similarity index 100% rename from libsigner/src/libsigner.rs rename to libsigner/src/lib.rs diff --git a/stacks-common/Cargo.toml b/stacks-common/Cargo.toml index 863a82d53c..650446ea25 100644 --- a/stacks-common/Cargo.toml +++ b/stacks-common/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" [lib] name = "stacks_common" -path = "./src/libcommon.rs" +path = "./src/lib.rs" [dependencies] rand = "0.7.3" diff --git a/stacks-common/src/libcommon.rs b/stacks-common/src/lib.rs similarity index 100% rename from stacks-common/src/libcommon.rs rename to stacks-common/src/lib.rs