-
Notifications
You must be signed in to change notification settings - Fork 4
Milestone 1: Language compatibility update & automation #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6657ebb
feat: bump rust and aptos versions (#98)
ctoyan 2641c6a
feat: add a progressbar to mutant testing (#100)
joske 398bc5b
chore: add test for Move v2.2 new function values (#101)
ctoyan 50f0532
chore: pin aptos-stdlib version in move-assets to v1.35 (#108)
ctoyan ee359c6
feat: automated CI releases (#104)
ctoyan 74d072a
chore: update release docs (#105)
ctoyan b72c666
fix: clippy errors and failing CI (#109)
ctoyan ea4118b
fix: fix failing CI matrix build
ctoyan a01177e
chore: add more tests for Move 2 features (#111)
ctoyan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,295 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| jobs: | ||
| build-and-release: | ||
| name: Build ${{ matrix.target }} | ||
| permissions: | ||
| contents: read | ||
| runs-on: ${{ matrix.runner }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # Linux x86_64 | ||
| - target: x86_64-unknown-linux-gnu | ||
| runner: self-hosted | ||
| asset_name: x86_64-unknown-linux-gnu | ||
|
|
||
| # Linux ARM64 (aarch64) | ||
| - target: aarch64-unknown-linux-gnu | ||
| runner: ubuntu-24.04-arm | ||
| asset_name: aarch64-unknown-linux-gnu | ||
|
|
||
| # macOS x86_64 | ||
| - target: x86_64-apple-darwin | ||
| runner: macos-13 | ||
| asset_name: x86_64-apple-darwin | ||
|
|
||
| # macOS ARM64 | ||
| - target: aarch64-apple-darwin | ||
| runner: macos-latest | ||
| asset_name: aarch64-apple-darwin | ||
|
|
||
| # Windows x86_64 | ||
| - target: x86_64-pc-windows-msvc | ||
| runner: windows-latest | ||
| asset_name: x86_64-windows | ||
| binary_ext: .exe | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Need full history to verify tag is from "main" branch | ||
|
|
||
| # - name: Verify tag is from main branch | ||
| # shell: bash | ||
| # run: | | ||
| # # Get the commit SHA that the tag points to | ||
| # TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref }}) | ||
| # | ||
| # # Check if this commit exists on main branch | ||
| # git fetch origin main | ||
| # if ! git merge-base --is-ancestor $TAG_COMMIT origin/main; then | ||
| # echo "Error: Tag must be created from main branch!" | ||
| # echo "This tag points to commit $TAG_COMMIT which is not on main branch." | ||
| # exit 1 | ||
| # fi | ||
| # echo "Tag is from main branch (commit: $TAG_COMMIT)" | ||
| # | ||
| # # Make sure that Cargo.toml version for each tool is the same as the tag | ||
| # - name: Verify version consistency | ||
| # shell: bash | ||
| # run: | | ||
| # # Extract version from tag | ||
| # TAG_VERSION="${GITHUB_REF#refs/tags/v}" | ||
| # | ||
| # # Check each tool's Cargo.toml version | ||
| # for tool in move-mutation-test move-mutator move-spec-test; do | ||
| # CARGO_VERSION=$(grep "^version" $tool/Cargo.toml | head -1 | cut -d'"' -f2) | ||
| # if [ "$CARGO_VERSION" != "$TAG_VERSION" ]; then | ||
| # echo "Error: Version mismatch for $tool!" | ||
| # echo " Tag version: $TAG_VERSION" | ||
| # echo " Cargo.toml version: $CARGO_VERSION" | ||
| # exit 1 | ||
| # fi | ||
| # echo "$tool version matches: $CARGO_VERSION" | ||
| # done | ||
|
|
||
| - name: Enable long paths on Windows | ||
| if: runner.os == 'Windows' | ||
| run: | | ||
| git config --system core.longpaths true | ||
| reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f | ||
| shell: pwsh | ||
|
|
||
| - name: Install required deps | ||
| if: runner.os == 'Linux' | ||
| run: sudo apt-get install libssl-dev pkg-config libudev-dev libdw-dev | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Install Aptos CLI | ||
| shell: bash | ||
| run: | | ||
| if [ "${{ runner.os }}" = "macOS" ]; then | ||
| echo "Installing Aptos CLI via Homebrew..." | ||
| brew install aptos | ||
| elif [ "${{ runner.os }}" = "Windows" ]; then | ||
| echo "Installing Aptos CLI via Chocolatey..." | ||
| choco install aptos -y | ||
| else | ||
| echo "Installing Aptos CLI via installer script..." | ||
| curl -fsSL "https://aptos.dev/scripts/install_cli.sh" | sh | ||
| source ~/.profile | ||
| APTOS_PATH=$(dirname $(which aptos)) | ||
| echo "$APTOS_PATH" >> $GITHUB_PATH | ||
| fi | ||
| aptos --version | ||
|
|
||
| - name: Cache Cargo | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/bin/ | ||
| ~/.cargo/registry/index/ | ||
| ~/.cargo/registry/cache/ | ||
| ~/.cargo/git/db/ | ||
| target/ | ||
| key: ${{ runner.os }}-${{ matrix.target }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} | ||
|
|
||
| - name: Build all tools | ||
| shell: bash | ||
| run: | | ||
| cargo build --release --bin move-mutation-test | ||
| cargo build --release --bin move-mutator | ||
| cargo build --release --bin move-spec-test | ||
|
|
||
| - name: Basic smoke test | ||
| shell: bash | ||
| run: | | ||
| ./target/release/move-mutation-test${{ matrix.binary_ext }} --version | ||
| ./target/release/move-mutator${{ matrix.binary_ext }} --version | ||
| ./target/release/move-spec-test${{ matrix.binary_ext }} --version | ||
|
|
||
| - name: Test move-mutation-test tool on simple_move_2_features (Linux, Mac, Windows) | ||
| shell: bash | ||
| run: | | ||
| if [ "${{ runner.os }}" = "Windows" ]; then | ||
| choco install unxutils strawberryperl | ||
| fi | ||
|
|
||
| echo "Testing mutation tools on simple_move_2_features project..." | ||
| cd move-mutator/tests/move-assets/simple_move_2_features | ||
|
|
||
| echo "Generating coverage data with aptos move test..." | ||
| aptos move test --coverage | ||
|
|
||
| echo "Running move-mutation-test with coverage..." | ||
| if [ "${{ runner.os }}" = "Windows" ]; then | ||
| ../../../../target/release/move-mutation-test.exe run --coverage --output report-mutation-generated.txt | ||
| else | ||
| ../../../../target/release/move-mutation-test run --coverage --output report-mutation-generated.txt | ||
| fi | ||
|
|
||
| if [ "${{ runner.os }}" = "Windows" ]; then | ||
| # HACK: Normalize Windows path. This only works because we test a single Move project | ||
| sed -i 's/"sources\\\\Operators.move"/"sources\/Operators.move"/g' report-mutation-generated.txt | ||
| fi | ||
|
|
||
| # Remove trailing newlines from both files | ||
| perl -pi -e 'chomp if eof' report-mutation-generated.txt | ||
| perl -pi -e 'chomp if eof' report.txt.mutation-exp | ||
|
|
||
| # Get all lines except last 3 (excluding package_dir) | ||
| LINES_GEN=$(wc -l < report-mutation-generated.txt) | ||
| LINES_EXP=$(wc -l < report.txt.mutation-exp) | ||
| KEEP_GEN=$((LINES_GEN - 3)) | ||
| KEEP_EXP=$((LINES_EXP - 3)) | ||
|
|
||
| head -n "$KEEP_GEN" report-mutation-generated.txt > report-mutation-gen-trimmed.txt | ||
| head -n "$KEEP_EXP" report.txt.mutation-exp > report-mutation-exp-trimmed.txt | ||
|
|
||
| if diff -B report-mutation-gen-trimmed.txt report-mutation-exp-trimmed.txt > /dev/null 2>&1; then | ||
| echo "move-mutation-test report matches expected" | ||
| rm -f report-mutation-gen-trimmed.txt report-mutation-exp-trimmed.txt | ||
| else | ||
| echo "move-mutation-test report differs from expected" | ||
| echo "=== Differences ===" | ||
| diff -B report-mutation-gen-trimmed.txt report-mutation-exp-trimmed.txt || true | ||
| rm -f report-mutation-gen-trimmed.txt report-mutation-exp-trimmed.txt | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Determine version for asset naming | ||
| - name: Get version | ||
| id: version | ||
| shell: bash | ||
| run: | | ||
| # Extract version from tag (remove 'v' prefix) | ||
| VERSION="${GITHUB_REF#refs/tags/v}" | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Package all tools for release | ||
| shell: bash | ||
| run: | | ||
| mkdir -p package | ||
|
|
||
| cp target/release/move-mutation-test${{ matrix.binary_ext }} package/move-mutation-test${{ matrix.binary_ext }} | ||
| cp target/release/move-mutator${{ matrix.binary_ext }} package/move-mutator${{ matrix.binary_ext }} | ||
| cp target/release/move-spec-test${{ matrix.binary_ext }} package/move-spec-test${{ matrix.binary_ext }} | ||
|
|
||
| cd package | ||
| if [ "${{ runner.os }}" = "Windows" ]; then | ||
| 7z a -tzip ../mutation-tools-${{ matrix.asset_name }}.zip * | ||
| else | ||
| zip -r ../mutation-tools-${{ matrix.asset_name }}.zip * | ||
| fi | ||
| cd .. | ||
|
|
||
| - name: Upload release artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: release-${{ matrix.target }} | ||
| path: | | ||
| mutation-tools-${{ matrix.asset_name }}.zip | ||
|
|
||
| create-release: | ||
| name: Create GitHub Release | ||
| runs-on: self-hosted | ||
| needs: build-and-release | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Determine version | ||
| id: version | ||
| run: | | ||
| TAG="${GITHUB_REF#refs/tags/}" | ||
| VERSION="${TAG#v}" | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
| echo "tag=$TAG" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: artifacts | ||
|
|
||
| - name: Prepare release assets | ||
| run: | | ||
| mkdir -p release-assets | ||
| find artifacts -name "*.zip" | while read file; do | ||
| cp "$file" release-assets/ | ||
| done | ||
| ls -lh release-assets/ | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ steps.version.outputs.tag }} | ||
| name: Move Mutation Tools v${{ steps.version.outputs.version }} | ||
| body: | | ||
| ## Installation Options | ||
|
|
||
| ### Via Aptos CLI (Recommended for most users) | ||
| ```bash | ||
| aptos update move-mutation-test | ||
| ``` | ||
| This installs `move-mutation-test` which is the main tool most users need. | ||
|
|
||
| ### Direct Download (All tools) | ||
| Download the appropriate archive for your platform below. Each archive contains: | ||
| - `move-mutation-test` - Tests the quality of your unit test suite | ||
| - `move-mutator` - Core mutation engine for advanced users | ||
| - `move-spec-test` - Tests the quality of your formal specifications | ||
|
|
||
| ## Platform Support | ||
|
|
||
| | Platform | Architecture | File | | ||
| |----------|--------------|------| | ||
| | Linux | x86_64 | `mutation-tools-x86_64-unknown-linux-gnu.zip` | | ||
| | Linux | ARM64/aarch64 | `mutation-tools-aarch64-unknown-linux-gnu.zip` | | ||
| | macOS | x86_64 (Intel) | `mutation-tools-x86_64-apple-darwin.zip` | | ||
| | macOS | ARM64 (Apple Silicon) | `mutation-tools-aarch64-apple-darwin.zip` | | ||
| | Windows | x86_64 | `mutation-tools-x86_64-windows.zip` | | ||
|
|
||
| ## Documentation | ||
| For usage instructions and examples, visit: https://github.com/eigerco/move-mutation-tools | ||
| draft: true | ||
| prerelease: false | ||
| files: release-assets/* | ||
| fail_on_unmatched_files: true | ||
| generate_release_notes: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.