mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 13:56:30 +03:00
ci: make Rust cache more useful
Separate the cache for different Rust versions and only write to the cache from the main branch.
This commit is contained in:
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@@ -41,6 +41,9 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
- name: Cache rust cargo artifacts
|
- name: Cache rust cargo artifacts
|
||||||
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
|
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
|
||||||
|
with:
|
||||||
|
save-if: false
|
||||||
|
shared-key: ${{ runner.os }}-${{ env.RUST_VERSION }}
|
||||||
- name: Run rustfmt
|
- name: Run rustfmt
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
- name: Run clippy
|
- name: Run clippy
|
||||||
@@ -90,8 +93,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
|
- run: rustup override set $RUST_VERSION
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Cache rust cargo artifacts
|
- name: Cache rust cargo artifacts
|
||||||
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
|
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
|
||||||
|
with:
|
||||||
|
save-if: false
|
||||||
|
shared-key: ${{ runner.os }}-${{ env.RUST_VERSION }}
|
||||||
- name: Rustdoc
|
- name: Rustdoc
|
||||||
run: cargo doc --document-private-items --no-deps
|
run: cargo doc --document-private-items --no-deps
|
||||||
|
|
||||||
@@ -135,6 +145,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache rust cargo artifacts
|
- name: Cache rust cargo artifacts
|
||||||
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
|
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
|
||||||
|
with:
|
||||||
|
# Only save the cache from the main branch runs.
|
||||||
|
# No need for PRs to write to the cache.
|
||||||
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
shared-key: ${{ matrix.os }}-${{ matrix.rust }}
|
||||||
|
|
||||||
- name: Install nextest
|
- name: Install nextest
|
||||||
uses: taiki-e/install-action@5f57d6cb7cd20b14a8a27f522884c4bc8a187458
|
uses: taiki-e/install-action@5f57d6cb7cd20b14a8a27f522884c4bc8a187458
|
||||||
@@ -167,8 +182,14 @@ jobs:
|
|||||||
show-progress: false
|
show-progress: false
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
|
- run: rustup override set $RUST_VERSION
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Cache rust cargo artifacts
|
- name: Cache rust cargo artifacts
|
||||||
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
|
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
|
||||||
|
with:
|
||||||
|
save-if: false
|
||||||
|
shared-key: ${{ matrix.os }}-${{ env.RUST_VERSION }}
|
||||||
|
|
||||||
- name: Build C library
|
- name: Build C library
|
||||||
run: cargo build -p deltachat_ffi
|
run: cargo build -p deltachat_ffi
|
||||||
@@ -193,8 +214,14 @@ jobs:
|
|||||||
show-progress: false
|
show-progress: false
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
|
- run: rustup override set $RUST_VERSION
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Cache rust cargo artifacts
|
- name: Cache rust cargo artifacts
|
||||||
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
|
uses: swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
|
||||||
|
with:
|
||||||
|
save-if: false
|
||||||
|
shared-key: ${{ runner.os }}-${{ env.RUST_VERSION }}
|
||||||
|
|
||||||
- name: Build deltachat-rpc-server
|
- name: Build deltachat-rpc-server
|
||||||
run: cargo build -p deltachat-rpc-server
|
run: cargo build -p deltachat-rpc-server
|
||||||
|
|||||||
Reference in New Issue
Block a user