Skip to content
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

ci: Use cargo-action-fmt to annotate PRs #1492

Merged
merged 4 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- cron: "30 7 * * 3"

env:
CARGO_ACTION_FMT_VERSION: v0.1.3
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
Expand All @@ -26,6 +27,10 @@ jobs:
timeout-minutes: 20
continue-on-error: true
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: |
curl --proto =https --tlsv1.3 -vsSfLo /usr/local/bin/cargo-action-fmt "https://github.com/olix0r/cargo-action-fmt/releases/download/release%2F${CARGO_ACTION_FMT_VERSION}/cargo-action-fmt-x86_64-unknown-linux-gnu"
chmod 755 /usr/local/bin/cargo-action-fmt
- run: rustup toolchain install --profile=minimal beta
- run: cargo +beta build --release -p linkerd2-proxy
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: cargo +beta fetch
- run: cargo +beta build --release -p linkerd2-proxy --message-format=json | cargo-action-fmt
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- .github/workflows/build.yml

env:
CARGO_ACTION_FMT_VERSION: v0.1.3
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
Expand All @@ -24,7 +25,9 @@ jobs:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- run: |
curl --proto =https --tlsv1.3 -vsSfLo /usr/local/bin/cargo-action-fmt "https://github.com/olix0r/cargo-action-fmt/releases/download/release%2F${CARGO_ACTION_FMT_VERSION}/cargo-action-fmt-x86_64-unknown-linux-gnu"
chmod 755 /usr/local/bin/cargo-action-fmt
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- env:
CARGO_RELEASE: "1"
run: make build
- run: cargo fetch
- run: cargo build --release -p linkerd2-proxy --message-format=json | cargo-action-fmt
14 changes: 9 additions & 5 deletions .github/workflows/check-each.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
- .github/workflows/check-each.yml

env:
CARGO_ACTION_FMT_VERSION: v0.1.3
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
DEBIAN_FRONTEND: noninteractive
Expand All @@ -28,8 +29,8 @@ jobs:
container:
image: docker://rust:1.56.1-buster
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: apt update && apt install -y jq
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: cargo fetch
- name: list crates
id: list-crates
Expand All @@ -38,7 +39,7 @@ jobs:
| jq -cr "[.packages[] | select(.manifest_path | startswith(\"$PWD\")) | .name]")
echo "::set-output name=crates::$crates"
outputs:
crates: ${{ steps.list-crates.outputs.crates }}`
crates: ${{ steps.list-crates.outputs.crates }}

check:
needs: enumerate
Expand All @@ -50,10 +51,13 @@ jobs:
matrix:
crate: ${{ fromJson(needs.enumerate.outputs.crates) }}
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: cargo fetch
- run: |
curl --proto =https --tlsv1.3 -vsSfLo /usr/local/bin/cargo-action-fmt "https://github.com/olix0r/cargo-action-fmt/releases/download/release%2F${CARGO_ACTION_FMT_VERSION}/cargo-action-fmt-x86_64-unknown-linux-gnu"
chmod 755 /usr/local/bin/cargo-action-fmt
- name: install meshtls-boring build deps
if: matrix.crate == 'linkerd-meshtls-boring'
run: apt update && apt install -y clang cmake
- run: cargo check -p ${{ matrix.crate }} --frozen --all-targets
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: cargo fetch
- run: cargo check -p ${{ matrix.crate }} --frozen --all-targets --message-format=json | cargo-action-fmt

18 changes: 14 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- .github/workflows/lint.yml

env:
CARGO_ACTION_FMT_VERSION: v0.1.3
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
Expand All @@ -23,18 +24,22 @@ jobs:
container:
image: docker://rust:1.56.1-buster
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: |
curl --proto =https --tlsv1.3 -vsSfLo /usr/local/bin/cargo-action-fmt "https://github.com/olix0r/cargo-action-fmt/releases/download/release%2F${CARGO_ACTION_FMT_VERSION}/cargo-action-fmt-x86_64-unknown-linux-gnu"
chmod 755 /usr/local/bin/cargo-action-fmt
- run: rustup component add clippy
- run: cargo clippy --all --exclude=linkerd-meshtls-boring
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: cargo fetch
- run: cargo clippy --all --exclude=linkerd-meshtls-boring --message-format=json | cargo-action-fmt

fmt:
timeout-minutes: 10
runs-on: ubuntu-latest
container:
image: docker://rust:1.56.1-buster
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: rustup component add rustfmt
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: make check-fmt

docs:
Expand All @@ -43,10 +48,15 @@ jobs:
container:
image: docker://rust:1.56.1-buster
steps:
- run: |
curl --proto =https --tlsv1.3 -vsSfLo /usr/local/bin/cargo-action-fmt "https://github.com/olix0r/cargo-action-fmt/releases/download/release%2F${CARGO_ACTION_FMT_VERSION}/cargo-action-fmt-x86_64-unknown-linux-gnu"
chmod 755 /usr/local/bin/cargo-action-fmt
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: cargo fetch
- run: |
cargo doc --all --no-deps \
--exclude=linkerd-meshtls \
--exclude=linkerd-meshtls-boring \
--exclude=linkerd-meshtls-rustls
--exclude=linkerd-meshtls-rustls \
--message-format=json | cargo-action-fmt

9 changes: 7 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- cron: "0 8 * * *"

env:
CARGO_ACTION_FMT_VERSION: v0.1.3
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
Expand All @@ -26,6 +27,10 @@ jobs:
timeout-minutes: 20
continue-on-error: true
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: |
curl --proto =https --tlsv1.3 -vsSfLo /usr/local/bin/cargo-action-fmt "https://github.com/olix0r/cargo-action-fmt/releases/download/release%2F${CARGO_ACTION_FMT_VERSION}/cargo-action-fmt-x86_64-unknown-linux-gnu"
chmod 755 /usr/local/bin/cargo-action-fmt
- run: rustup toolchain install --profile=minimal nightly
- run: cargo +nightly build --release -p linkerd2-proxy
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: cargo +nightly fetch
- run: cargo +nightly build --release -p linkerd2-proxy --message-format=json | cargo-action-fmt
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- "release/*"

permissions:
contents: write

env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
Expand Down