-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: install
protoc
from repositories where possible (#3258)
With the addition of more CI jobs, we are constantly running into API limits on setting up protoc. For all jobs that run on ubuntu, we can install it from `apt` instead. On ubuntu 22.04, which is what `ubuntu-latest` points to, this installs `protoc v3.12.4`. (cherry picked from commit 68d0f88) # Conflicts: # .github/workflows/cache-factory.yml # .github/workflows/ci.yml
- Loading branch information
1 parent
ace63fe
commit 75d491d
Showing
2 changed files
with
228 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,80 @@ | ||
# This workflow _produces_ caches which are used to speed up pull request builds. | ||
# The caches are split by Rust version (stable vs MSRV per crate) because those caches cannot share any artifacts. | ||
|
||
name: Cache factory | ||
|
||
on: | ||
push: | ||
branches: | ||
- master # Caches are only created on master branch. | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
gather_msrv_versions: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
versions: ${{ steps.find-rust-versions.outputs.versions }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- id: find-rust-versions | ||
run: | | ||
RUST_VERSIONS=$(cargo metadata --format-version=1 --no-deps | jq -c '.packages | map(.rust_version) | unique | del(..|nulls)') | ||
echo "versions=${RUST_VERSIONS}" >> $GITHUB_OUTPUT | ||
make_msrv_cache: | ||
runs-on: ubuntu-latest | ||
needs: gather_msrv_versions | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust: ${{ fromJSON(needs.gather_msrv_versions.outputs.versions) }} | ||
steps: | ||
- name: Install Protoc | ||
run: sudo apt-get install protobuf-compiler | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
|
||
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 | ||
with: | ||
shared-key: msrv-cache | ||
|
||
- name: Compile all crates which have MSRV ${{ matrix.rust }} | ||
run: | | ||
cargo metadata --format-version=1 --no-deps | \ | ||
jq -r '.packages[] | select(.rust_version == "${{ matrix.rust }}") | "+\(.rust_version) build --all-features --package \(.name)"' | | ||
xargs --verbose -L 1 cargo | ||
make_stable_rust_cache: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Protoc | ||
run: sudo apt-get install protobuf-compiler | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 | ||
with: | ||
shared-key: stable-cache | ||
|
||
- name: Compile workspace with stable Rust | ||
run: cargo test --all-features --all-targets --workspace --no-run | ||
|
||
- name: Render docs | ||
run: cargo doc --all-features --workspace | ||
|
||
- name: Install tools | ||
run: cargo install cargo-semver-checks --locked |
This file contains 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