diff --git a/.github/workflows/semver-check.yaml b/.github/workflows/semver-check.yaml index a25eb8ba44..45ee8419f4 100644 --- a/.github/workflows/semver-check.yaml +++ b/.github/workflows/semver-check.yaml @@ -2,83 +2,26 @@ name: Semver Check on: push: - branches: + branches: - "main" - "dev" pull_request: - branches: + branches: - "main" - "dev" jobs: semver-check: runs-on: ubuntu-latest - strategy: - matrix: - include: - - crate: "utils/buffer" - command: "cargo semver-checks" - - crate: "protocols/v2/binary-sv2/no-serde-sv2/derive_codec" - command: "cargo semver-checks" - - crate: "protocols/v2/binary-sv2/no-serde-sv2/codec" - command: "cargo semver-checks" - - crate: "protocols/v2/binary-sv2/serde-sv2" - command: "cargo semver-checks" - - crate: "protocols/v2/binary-sv2/binary-sv2" - command: "cargo semver-checks" - - crate: "protocols/v2/const-sv2" - command: "cargo semver-checks" - - crate: "protocols/v2/framing-sv2" - command: "cargo semver-checks" - - crate: "protocols/v2/noise-sv2" - command: "cargo semver-checks" - - crate: "protocols/v2/codec-sv2" - command: "cargo semver-checks" - - crate: "protocols/v2/subprotocols/common-messages" - command: "cargo semver-checks" - - crate: "protocols/v2/subprotocols/job-declaration" - command: "cargo semver-checks" - - crate: "protocols/v2/subprotocols/mining" - command: "cargo semver-checks" - - crate: "protocols/v2/subprotocols/template-distribution" - command: "cargo semver-checks" - - crate: "protocols/v2/sv2-ffi" - command: "cargo semver-checks" - - crate: "protocols/v2/roles-logic-sv2" - command: "cargo semver-checks" - - crate: "protocols/v1" - command: "cargo semver-checks" - - crate: "utils/bip32-key-derivation" - command: "cargo semver-checks" - - crate: "utils/error-handling" - command: "cargo semver-checks" - - crate: "utils/key-utils" - command: "cargo semver-checks" - - crate: "roles/roles-utils/network-helpers" - command: "cargo semver-checks" - - crate: "roles/roles-utils/rpc" - command: "cargo semver-checks" - - crate: "roles/jd-client" - command: "cargo semver-checks" - - crate: "roles/jd-server" - command: "cargo semver-checks" - - crate: "roles/mining-proxy" - command: "cargo semver-checks" - - crate: "roles/pool" - command: "cargo semver-checks" - - crate: "roles/translator" - command: "cargo semver-checks" - - crate: "common" - command: "cargo semver-checks" steps: - name: Checkout repository uses: actions/checkout@v2 - - name: Install Rust + - name: Install Rust 1.75.0 uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: 1.75.0 override: true - name: Cache Cargo registry @@ -103,29 +46,86 @@ jobs: - name: Install cargo-semver-checks run: cargo install cargo-semver-checks --locked - - name: Fetch all branches - run: git fetch --all - - - name: Identify target branch - id: target_branch - run: echo "::set-output name=branch::$(git rev-parse --abbrev-ref --symbolic-full-name @{u} | cut -d'/' -f2)" - - - name: Identify changed crates - id: changes - run: | - TARGET_BRANCH=$(echo "${{ steps.target_branch.outputs.branch }}") - echo "::set-output name=changed_crates::$(git diff --name-only origin/$TARGET_BRANCH...HEAD | grep '^crates/' | cut -d'/' -f2 | sort | uniq)" - - - name: Run semver checks - if: steps.changes.outputs.changed_crates - run: | - for crate in ${{ steps.changes.outputs.changed_crates }}; do - echo "Checking semver for crate: $crate" - cd $crate - ${{ matrix.command }} - cd .. - done - - - name: Notify on failure - if: failure() - run: echo "Semver checks failed for one or more crates" + - name: Run semver checks for common + working-directory: common + run: cargo semver-checks + + - name: Run semver checks for utils/buffer + working-directory: utils/buffer + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/binary-sv2/no-serde-sv2/codec + working-directory: protocols/v2/binary-sv2/no-serde-sv2/codec + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/binary-sv2/serde-sv2 + working-directory: protocols/v2/binary-sv2/serde-sv2 + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/binary-sv2/binary-sv2 + working-directory: protocols/v2/binary-sv2/binary-sv2 + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/const-sv2 + working-directory: protocols/v2/const-sv2 + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/framing-sv2 + working-directory: protocols/v2/framing-sv2 + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/noise-sv2 + working-directory: protocols/v2/noise-sv2 + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/codec-sv2 + working-directory: protocols/v2/codec-sv2 + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/subprotocols/common-messages + working-directory: protocols/v2/subprotocols/common-messages + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/subprotocols/job-declaration + working-directory: protocols/v2/subprotocols/job-declaration + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/subprotocols/mining + working-directory: protocols/v2/subprotocols/mining + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/subprotocols/template-distribution + working-directory: protocols/v2/subprotocols/template-distribution + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/sv2-ffi + working-directory: protocols/v2/sv2-ffi + run: cargo semver-checks + + - name: Run semver checks for protocols/v2/roles-logic-sv2 + working-directory: protocols/v2/roles-logic-sv2 + run: cargo semver-checks + + - name: Run semver checks for protocols/v1 + working-directory: protocols/v1 + run: cargo semver-checks + + - name: Run semver checks for utils/bip32-key-derivation + working-directory: utils/bip32-key-derivation + run: cargo semver-checks + + - name: Run semver checks for utils/error-handling + working-directory: utils/error-handling + run: cargo semver-checks + + - name: Run semver checks for utils/key-utils + working-directory: utils/key-utils + run: cargo semver-checks + + - name: Run semver checks for roles/roles-utils/network-helpers + working-directory: roles/roles-utils/network-helpers + run: cargo semver-checks + + - name: Run semver checks for roles/roles-utils/rpc + working-directory: roles/roles-utils/rpc + run: cargo semver-checks \ No newline at end of file