diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 682a9b712b66..018a67e28650 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -68,59 +68,6 @@ jobs: with: jobs: ${{ toJSON(needs) }} - generate-check-examples-matrix: - runs-on: ubuntu-latest - name: Generate Check Matrix (examples) - steps: - - uses: actions/checkout@v3 - - name: Generate the matrix - id: generate-matrix - # Run the `crate-range.py` script to calculate a matrix for the `check-examples` job. - # This script outputs JSON that GitHub Actions can consume as a matrix definition. - # Rust versions to check against are arguments to this script. - run: echo "matrix=$(./tools/ci/crate-range.py generate-matrix -b ${EXAMPLES_BATCH_COUNT} --folder examples ${RUST_VERSIONS})" >> "${GITHUB_OUTPUT}" - outputs: - matrix: ${{ steps.generate-matrix.outputs.matrix }} - - check-examples: - needs: generate-check-examples-matrix - runs-on: ubuntu-latest - name: Check Examples - env: - CARGO_INCREMENTAL: "0" - RUSTFLAGS: "" - RUSTDOCFLAGS: "" - strategy: - # Use the matrix generated by the previous job - matrix: ${{ fromJson(needs.generate-check-examples-matrix.outputs.matrix) }} - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust_version }} - targets: wasm32-unknown-unknown - # Pinned to the commit hash of v2.1.0 - - uses: Swatinem/rust-cache@b894d59a8d236e2979b247b80dac8d053ab340dd - with: - shared-key: check - - name: Cargo Check - run: ./tools/ci/crate-range.py run ${{ matrix.crate_range }} --folder examples -- cargo check --all-features - - # Psuedo-job that depends on the check job so that we don't have to enter - # the myriad of crate range combinations into GitHub's protected branch rules - require-check-examples: - needs: check-examples - # Run this job even if its dependency jobs fail - if: always() - runs-on: ubuntu-latest - name: Check Matrix Success (examples) - steps: - - name: Verify jobs succeeded - # Pinned to commit hash of v1.2.2 - uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe - with: - jobs: ${{ toJSON(needs) }} - check-manifests: runs-on: ubuntu-latest steps: diff --git a/tools/ci/crate-range.py b/tools/ci/crate-range.py index eec72b199293..165fd9f3922e 100755 --- a/tools/ci/crate-range.py +++ b/tools/ci/crate-range.py @@ -10,14 +10,14 @@ # # generate-matrix # -# This sub-command counts the total number of crates in the SDK (including examples), +# This sub-command counts the total number of crates in the SDK, # and creates a set of batches based on that size in a format that GitHub Actions # can consume as a matrix strategy. # # run # # This sub-command will run the given command on the given crate range. -# It deterministically distributes the SDK crates (including examples) fairly across +# It deterministically distributes the SDK crates fairly across # the batch range by counting lines of code in attempt to keep batches with roughly # the same workloads. # @@ -109,7 +109,7 @@ def organize_crate_list(batch_count, crates): return result -# Lists all SDK crates including examples +# Lists all SDK crates def list_crates(repository_root, path): to_examine = [] to_examine.extend(list(map(lambda p: f"{repository_root}/{path}/{p}", os.listdir(f"{repository_root}/{path}")))) @@ -179,7 +179,7 @@ def main(): subparser_generate_matrix = subparsers.add_parser("generate-matrix", help="Generate a test matrix") subparser_generate_matrix.add_argument("rust_versions", type=str, nargs=argparse.ONE_OR_MORE) subparser_generate_matrix.add_argument("-b", type=int, dest="batches", required=True, help="Number of batches") - subparser_generate_matrix.add_argument("--folder", required=True, type=str, choices=["sdk", "examples"], + subparser_generate_matrix.add_argument("--folder", required=True, type=str, choices=["sdk"], help="Name of the folder containing the crates you want to generate a " "matrix for") @@ -187,7 +187,7 @@ def main(): subparser_run.add_argument("-b", required=True, type=int, dest="batches", help="Number of batches") subparser_run.add_argument("-s", required=True, type=int, dest="start_inclusive", help="Range start inclusive") subparser_run.add_argument("-e", required=True, type=int, dest="end_exclusive", help="Range end exclusive") - subparser_run.add_argument("--folder", required=True, type=str, choices=["sdk", "examples"], + subparser_run.add_argument("--folder", required=True, type=str, choices=["sdk"], help="Name of the folder containing the crates you want to run a command on") subparser_run.add_argument("cmd", type=str, nargs=argparse.ONE_OR_MORE)