Skip to content

Commit

Permalink
chore: add cache
Browse files Browse the repository at this point in the history
  • Loading branch information
m-shaka committed Sep 12, 2024
1 parent 5401902 commit 832882b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<<EOF'
Expand All @@ -221,4 +225,18 @@ jobs:
# with:
# comment_tag: type-check-perf
# message: ${{ env.COMPARISON }}


post-type-check-perf-on-main:
runs-on: ubuntu-latest
needs: type-check-perf-monitoring
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: echo -e "${{ needs.type-check-perf-monitoring.outputs.diagnostics }}" > 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 }}
2 changes: 1 addition & 1 deletion type-check-perf/process-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 7 in type-check-perf/process-results.ts

View check run for this annotation

Codecov / codecov/patch

type-check-perf/process-results.ts#L3-L7

Added lines #L3 - L7 were not covered by tests
// currentResultとpreviousResultを結合してmarkdownのテーブルを作る
Expand Down

0 comments on commit 832882b

Please sign in to comment.