用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vamseeachanta/workspace-hub --skill github-actions-3-caching-strategies命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | github-actions-3-caching-strategies |
| description | Sub-skill of github-actions: 3. Caching Strategies (+1). |
| version | 1.0.0 |
| category | operations |
| type | reference |
| scripts_exempt | true |
# .github/workflows/caching.yml
name: Build with Caching
on: [push, pull_request]
jobs:
build-with-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Python pip cache
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: |
requirements.txt
requirements-dev.txt
# Node modules cache
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: package-lock.json
# Custom cache for build artifacts
- name: Cache build outputs
uses: actions/cache@v4
id: build-cache
with:
path: |
build/
dist/
.pytest_cache/
key: build-${{ runner.os }}-${{ hashFiles('src/**', 'pyproject.toml') }}
restore-keys: |
build-${{ runner.os }}-
# Docker layer cache
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: docker-${{ runner.os }}-${{ hashFiles('Dockerfile') }}
restore-keys: |
docker-${{ runner.os }}-
# Rust cargo cache
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-${{ runner.os }}-
- name: Skip build if cached
if: steps.build-cache.outputs.cache-hit == 'true'
run: echo "Using cached build artifacts"
- name: Build
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
pip install -e ".[dev]"
python -m build
- name: Run tests
run: pytest tests/ -v
# .github/workflows/artifacts.yml
name: Build and Release Artifacts
on:
push:
tags: ['v*']
workflow_dispatch:
jobs:
build-artifacts:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: app-linux-x64
asset_name: app-linux-x64.tar.gz
- os: macos-latest
artifact_name: app-macos-x64
asset_name: app-macos-x64.tar.gz
- os: windows-latest
artifact_name: app-windows-x64
asset_name: app-windows-x64.zip
steps:
- uses: actions/checkout@v4
- name: Build application