Skip to content

Commit

Permalink
GitHub CI improvements.
Browse files Browse the repository at this point in the history
* Only run the image build on main and tags (not needed on feature branches).
* Cache rust dependencies to speed builds up.
  • Loading branch information
chirino committed May 22, 2024
1 parent 0a70dff commit d84f647
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ name: Build Image
on:
workflow_dispatch:
push:
branches: ['*']
tags: ['*']
branches:
- main
tags:
- "*"

env:
IMG_REGISTRY_HOST: quay.io
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
Expand All @@ -33,6 +34,7 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- uses: Swatinem/rust-cache@v2
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
Expand All @@ -32,6 +33,7 @@ jobs:
with:
redis-version: 7
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
Expand All @@ -45,6 +47,7 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check

clippy:
Expand All @@ -55,6 +58,7 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
Expand All @@ -69,6 +73,7 @@ jobs:
with:
redis-version: 7
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
Expand Down

0 comments on commit d84f647

Please sign in to comment.