chore(deps): bump tonic from 0.12.1 to 0.12.3 #273
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
name: Build pipeline | |
on: [push, pull_request] | |
env: | |
RUST_TOOLCHAIN_VERSION: "1.79.0" | |
RUSTFLAGS: "-D warnings" | |
RUSTDOCFLAGS: "-D warnings" | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }} | |
- run: cargo test --all-features | |
clippy: | |
name: Check clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }} | |
components: clippy | |
- run: cargo clippy --all-targets -- -D warnings | |
fmt: | |
name: Check formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }} | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
docs: | |
name: Generate docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
- uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }} | |
- run: cargo doc --document-private-items | |
docker-image: | |
name: Build and push docker image | |
needs: [test, clippy, fmt, docs] | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
- name: Set up Cosign | |
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0 | |
- name: Login to Stackable Harbor | |
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 | |
with: | |
registry: oci.stackable.tech | |
username: robot$stackable+github-action-build | |
password: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }} | |
- name: Build and (optionally) push docker image | |
env: | |
TRIGGER: ${{ github.event_name }} | |
GITHUB_REF: ${{ github.ref }} | |
run: | | |
# trino-lb is not (yet) a product as the SDP, but a community project, so use "stackable" instead of "sdp" | |
IMAGE_NAME="oci.stackable.tech/stackable/trino-lb" | |
TAG_NAME="dev" | |
docker build -f docker/Dockerfile . -t "$IMAGE_NAME:$TAG_NAME" | |
if [[ $TRIGGER == "push" && $GITHUB_REF == "refs/heads/main" ]]; then | |
# Store the output of `docker image push` into a variable, so we can parse it for the digest | |
PUSH_OUTPUT=$(docker image push "$IMAGE_NAME:$TAG_NAME" 2>&1) | |
echo "$PUSH_OUTPUT" | |
# Obtain the digest of the pushed image from the output of `docker image push`, because signing by tag is deprecated and will be removed from cosign in the future | |
DIGEST=$(echo "$PUSH_OUTPUT" | awk "/: digest: sha256:[a-f0-9]{64} size: [0-9]+$/ { print \$3 }") | |
# Refer to image via its digest (oci.stackable.tech/stackable/trino-dev@sha256:0a1b2c...) | |
# This generates a signature and publishes it to the registry, next to the image | |
# Uses the keyless signing flow with Github Actions as identity provider | |
cosign sign -y "$IMAGE_NAME@$DIGEST" | |
fi |