diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index 3a16aff2a..7fe7b1c5b 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -20,11 +20,17 @@ runs: ~/.cargo key: ${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }} - uses: actions/cache@v4 - # Cache first-party code dependencies + # Cache Rust dependencies with: path: | .cargo key: ${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }}-${{ hashFiles('sources/Cargo.lock') }} + - uses: actions/cache@v4 + # Cache Go dependencies + with: + path: | + .gomodcache + key: ${{ hashFiles('.github/workflows/cache.yml') }}-${{ runner.os }}-${{ env.OS_ARCH }}-${{ hashFiles('sources/**/go.sum') }} - run: cargo install cargo-make shell: bash - if: ${{ inputs.perform-cache-cleanup }} diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 174a27241..5d975c9b6 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -1,4 +1,4 @@ -# This workflow caches crate dependencies and build artifacts for tools (except 'test-tools' since we don't use them in build workflows). +# This workflow caches crate dependencies, build tools, and external kits. # The cache is only usable by workflows started from pull requests against the develop branch. name: CacheDepsAndTools on: @@ -7,6 +7,7 @@ on: paths: - '.github/**' - 'sources/Cargo.lock' + - 'sources/**/go.sum' - 'Twoliter.toml' - 'Twoliter.lock' - 'Makefile' @@ -23,6 +24,13 @@ jobs: uses: ./.github/actions/setup-node with: perform-cache-cleanup: true - - run: cargo make install-twoliter + # This installs twoliter. + - run: make prep + # This fetches any external kit dependencies. + - run: make fetch + # This cleans the existing project local caches. + - run: make twoliter purge-cache + # This fetches Rust crate and Go module dependencies. + - run: make twoliter fetch # This cleans the cargo cache in ~/.cargo - run: cargo-cache