👷 CI: 缓存 NoneFlow 所需的 pre-commit hooks (#2104)

This commit is contained in:
uy/sun 2023-06-14 17:05:52 +08:00 committed by GitHub
parent 7d3c7c4933
commit 30dbd270a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ on:
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }} group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
cancel-in-progress: true cancel-in-progress: false
jobs: jobs:
plugin_test: plugin_test:
@ -72,6 +72,12 @@ jobs:
with: with:
token: ${{ steps.generate-token.outputs.token }} token: ${{ steps.generate-token.outputs.token }}
- name: Cache pre-commit hooks
uses: actions/cache@v3
with:
path: .cache/.pre-commit
key: noneflow-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: NoneFlow - name: NoneFlow
uses: docker://ghcr.io/nonebot/noneflow:latest uses: docker://ghcr.io/nonebot/noneflow:latest
with: with:
@ -88,3 +94,7 @@ jobs:
PLUGIN_TEST_METADATA: ${{ needs.plugin_test.outputs.metadata }} PLUGIN_TEST_METADATA: ${{ needs.plugin_test.outputs.metadata }}
APP_ID: ${{ secrets.APP_ID }} APP_ID: ${{ secrets.APP_ID }}
PRIVATE_KEY: ${{ secrets.APP_KEY }} PRIVATE_KEY: ${{ secrets.APP_KEY }}
PRE_COMMIT_HOME: /github/workspace/.cache/.pre-commit
- name: Fix permission
run: sudo chown -R $(whoami):$(id -ng) .cache/.pre-commit