From 832882b1e87b6a9f88fdd8ef3feb7d7be9f1c682 Mon Sep 17 00:00:00 2001 From: m-shaka Date: Thu, 12 Sep 2024 23:36:09 +0900 Subject: [PATCH] chore: add cache --- .github/workflows/ci.yml | 24 +++++++++++++++++++++--- type-check-perf/process-results.ts | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1b02cb31..2ab92eec6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -205,10 +205,14 @@ jobs: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v1 - run: bun install + - uses: actions/cache/restore@v4 + with: + path: type-check-perf/previous-result.txt + restore-keys: | + type-check-perf-previous-result- + key: type-check-perf-previous-result- - run: echo -e "${{ needs.type-check-perf-monitoring.outputs.diagnostics }}" > result.txt working-directory: type-check-perf - - run: cat result.txt - working-directory: type-check-perf - run: | { echo 'COMPARISON< previous-result.txt + working-directory: type-check-perf + - uses: actions/cache/save@v4 + with: + path: type-check-perf/previous-result.txt + key: type-check-perf-previous-result-${{ github.sha }} diff --git a/type-check-perf/process-results.ts b/type-check-perf/process-results.ts index 5b0ea65ad..a7e1aa6b7 100644 --- a/type-check-perf/process-results.ts +++ b/type-check-perf/process-results.ts @@ -2,7 +2,7 @@ import * as fs from 'node:fs/promises' async function main() { const currentResult = (await fs.readFile('./result.txt')).toString().split('\n') - const previousResult = await fs.readFile('./main-result.txt') + const previousResult = await fs.readFile('./previous-result.txt') .then((data) => data.toString().split('\n')) .catch(() => null) // currentResultとpreviousResultを結合してmarkdownのテーブルを作る