Skip to content

Commit

Permalink
ci cache
Browse files Browse the repository at this point in the history
  • Loading branch information
tossp committed Apr 10, 2022
1 parent a477832 commit 3e15ffc
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: 构建

on:
workflow_dispatch:
inputs:
clean_cache:
description: 'Test scenario tags'
required: false
type: boolean
push:
branches:
- master
Expand Down Expand Up @@ -60,17 +65,25 @@ jobs:

steps:
- name: 检出项目文件
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: 缓存加速
uses: actions/cache@v3
with:
path: |
cache/*.pat
cache/*.org
docker/downloads/*.txz
key: ${{matrix.platform}}-${{matrix.version}}-${{ hashFiles('global_config.json') }}
restore-keys: ${{matrix.platform}}-${{matrix.version}}-

- name: 清理缓存
if: "${{ github.event.inputs.clean_cache == 'true' }}"
run: |
rm -rf cache/*.pat
rm -rf cache/*.org
rm -rf docker/downloads/*.txz
- name: 准备构建环境
run: |
./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}}
Expand Down Expand Up @@ -123,7 +136,7 @@ jobs:
./redpill_tool_chain.sh auto ${{matrix.platform}}-${{matrix.version}}
- name: 上传引导镜像到 github actions
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: dsm-${{matrix.platform}}-${{matrix.version}}
path: images/redpill-*.img
Expand All @@ -132,7 +145,5 @@ jobs:
- name: 删除旧的工作流
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 3
keep_minimum_runs: 6
retain_days: 1
keep_minimum_runs: 3

0 comments on commit 3e15ffc

Please sign in to comment.