Browse Source

add Rust Caching to CI (#759)

* Add rust cache to the CI pipeline

* Don't update the run-on-arch github action
remotes/origin/feat/support-install-latest
Gal Schlezinger 3 years ago committed by GitHub
parent
commit
fd2a6eb650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      .github/workflows/rust.yml
  2. 9
      renovate.json

12
.github/workflows/rust.yml

@ -13,6 +13,7 @@ jobs:
- uses: hecrj/setup-rust-action@v1 - uses: hecrj/setup-rust-action@v1
with: with:
rust-version: stable rust-version: stable
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: cargo fmt - name: cargo fmt
run: cargo fmt -- --check run: cargo fmt -- --check
@ -23,6 +24,7 @@ jobs:
- uses: hecrj/setup-rust-action@v1 - uses: hecrj/setup-rust-action@v1
with: with:
rust-version: stable rust-version: stable
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: cargo clippy - name: cargo clippy
run: cargo clippy -- -D warnings run: cargo clippy -- -D warnings
@ -36,6 +38,7 @@ jobs:
- uses: hecrj/setup-rust-action@v1 - uses: hecrj/setup-rust-action@v1
with: with:
rust-version: stable rust-version: stable
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Run tests - name: Run tests
run: cargo test -- --skip=feature_tests run: cargo test -- --skip=feature_tests
@ -55,6 +58,7 @@ jobs:
- uses: hecrj/setup-rust-action@v1 - uses: hecrj/setup-rust-action@v1
with: with:
rust-version: stable rust-version: stable
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Run tests - name: Run tests
run: cargo test -- feature_tests run: cargo test -- feature_tests
@ -66,6 +70,7 @@ jobs:
- uses: hecrj/setup-rust-action@v1 - uses: hecrj/setup-rust-action@v1
with: with:
rust-version: stable rust-version: stable
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Build release binary - name: Build release binary
run: cargo build --release run: cargo build --release
@ -83,6 +88,7 @@ jobs:
- uses: hecrj/setup-rust-action@v1 - uses: hecrj/setup-rust-action@v1
with: with:
rust-version: stable rust-version: stable
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Build release binary - name: Build release binary
run: cargo build --release run: cargo build --release
@ -105,6 +111,9 @@ jobs:
with: with:
rust-version: stable rust-version: stable
targets: x86_64-unknown-linux-musl targets: x86_64-unknown-linux-musl
- uses: Swatinem/rust-cache@v1
with:
key: static-linux-binary
- name: Install musl tools - name: Install musl tools
run: | run: |
sudo apt-get update sudo apt-get update
@ -142,6 +151,9 @@ jobs:
- uses: hecrj/setup-rust-action@v1 - uses: hecrj/setup-rust-action@v1
with: with:
rust-version: stable rust-version: stable
- uses: Swatinem/rust-cache@v1
with:
key: arm-binary-${{ matrix.arch }}
- name: 'Download `cross` crate' - name: 'Download `cross` crate'
run: cargo install cross run: cargo install cross
- uses: actions/checkout@v3 - uses: actions/checkout@v3

9
renovate.json

@ -7,9 +7,12 @@
"groupName": "all non-major dependencies", "groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch" "groupSlug": "all-minor-patch"
} }
},
{
"matchPackagePatterns": ["uraimo/run-on-arch-action"],
"matchManagers": ["github-actions"],
"allowedVersions": "2.1.2"
} }
], ],
"extends": [ "extends": ["config:base"]
"config:base"
]
} }

Loading…
Cancel
Save