mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-20 14:31:15 +02:00
Set Rust caching key per language group (#2250)
Fixes #2247 (a follow-up from #2195). * Add a workflow dispatch manual trigger to the tests workflow. * Move the link-checked languages JSON list to the build job's env. * Set a caching key per language group to avoid extra `mdbook-linkcheck` installation on non-link-checked translations. For the meaning of this key, see: https://github.com/Swatinem/rust-cache?tab=readme-ov-file#example-usage * Fix newly broken web link in 8a3ed21 ✅ I tested it on my fork, and it looks good: https://github.com/jond01/comprehensive-rust/actions/workflows/build.yml https://github.com/jond01/comprehensive-rust/actions/caches
This commit is contained in:
parent
ad9b41cd6c
commit
4c28a9253b
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
@ -5,6 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
@ -120,6 +121,9 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
language: ${{ fromJSON(needs.find-languages.outputs.languages) }}
|
language: ${{ fromJSON(needs.find-languages.outputs.languages) }}
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
env:
|
||||||
|
# Opt-in for checking links in translations - add the language below.
|
||||||
|
LINK_CHECKED_LANGUAGES: '["en", ]'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -128,6 +132,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Rust cache
|
- name: Setup Rust cache
|
||||||
uses: ./.github/workflows/setup-rust-cache
|
uses: ./.github/workflows/setup-rust-cache
|
||||||
|
with:
|
||||||
|
key: ${{ contains(fromJSON(env.LINK_CHECKED_LANGUAGES), matrix.language) }}
|
||||||
|
|
||||||
- name: Install Gettext
|
- name: Install Gettext
|
||||||
run: |
|
run: |
|
||||||
@ -148,8 +154,7 @@ jobs:
|
|||||||
msgfmt -o /dev/null --statistics po/messages.pot
|
msgfmt -o /dev/null --statistics po/messages.pot
|
||||||
|
|
||||||
- name: Install mdbook-linkcheck
|
- name: Install mdbook-linkcheck
|
||||||
# Opt-in for checking links in translations - add the language below.
|
if: contains(fromJSON(env.LINK_CHECKED_LANGUAGES), matrix.language)
|
||||||
if: contains(fromJSON('["en", ]'), matrix.language)
|
|
||||||
run: cargo install mdbook-linkcheck --locked --version 0.7.7
|
run: cargo install mdbook-linkcheck --locked --version 0.7.7
|
||||||
|
|
||||||
- name: Build ${{ matrix.language }} translation
|
- name: Build ${{ matrix.language }} translation
|
||||||
|
13
.github/workflows/setup-rust-cache/action.yml
vendored
13
.github/workflows/setup-rust-cache/action.yml
vendored
@ -2,6 +2,12 @@ name: Setup Rust cache
|
|||||||
|
|
||||||
description: Configure the rust-cache workflow.
|
description: Configure the rust-cache workflow.
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
key:
|
||||||
|
description: Additional caching key
|
||||||
|
required: false
|
||||||
|
default:
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
@ -9,6 +15,7 @@ runs:
|
|||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
# Only save the cache on the main branch to avoid PRs filling
|
# Only save the cache on the main branch to avoid PRs filling
|
||||||
# up the cache. Further, only save it if we are working on the
|
# up the cache.
|
||||||
# English source (or if no language has been set).
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
save-if: ${{ github.ref == 'refs/heads/main' && (matrix.language == 'en' || matrix.language == '') }}
|
# Further, save the cache per key - e.g. language grouping.
|
||||||
|
key: ${{ inputs.key }}
|
||||||
|
@ -28,4 +28,4 @@ pub fn main(arg0: u64, arg1: u64, arg2: u64, arg3: u64) {
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
[1]: https://android.googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/master/vmbase/
|
[1]: https://android.googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/libs/libvmbase/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user