Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI の改善 #4

Closed
a01sa01to opened this issue Jul 3, 2023 · 5 comments · Fixed by #6
Closed

CI の改善 #4

a01sa01to opened this issue Jul 3, 2023 · 5 comments · Fixed by #6

Comments

@a01sa01to
Copy link
Member

lint.yml も同様っぽい...?

  • 2 回やってる
    - name: Checkout
    uses: actions/checkout@v3
    - uses: actions/checkout@v3
  • Matrix が定義されてないので空文字列になる
    - name: Use Node.js ${{ matrix.node-version }}
  • cache 周りは setup-pnpm を setup-node より前に持ってきて、setup-node に cache: pnpm を渡すと一瞬
    - name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
    id: pnpm-config
    shell: bash
    run: |
    echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
    - name: Cache rotation keys
    id: cache-rotation
    shell: bash
    run: |
    echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
    - uses: actions/cache@v3
    name: Setup pnpm cache
    with:
    path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
    key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
    restore-keys: |
    ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-
    ここら辺いらなくなりそう (ref: https://github.com/saitamau-maximum/blog/blob/f290d0e561aef6d2c8b266a9fbe2b165518bc2e7/.github/workflows/deploy.yml#L26-L34)
a01sa01to added a commit that referenced this issue Jul 3, 2023
@a01sa01to a01sa01to linked a pull request Jul 3, 2023 that will close this issue
@sor4chi
Copy link
Member

sor4chi commented Jul 3, 2023

そのキャッシュ方法だとダメだったみたいな話じゃなかったっけ?w

@sor4chi
Copy link
Member

sor4chi commented Jul 3, 2023

ちゃんと動いてるからmatrix消し忘れてた

a01sa01to added a commit that referenced this issue Jul 3, 2023
- checkout処理の重複を削除

- Cacheをsetup-nodeにお任せ

- matrixを定義
@a01sa01to
Copy link
Member Author

そのキャッシュ方法だとダメだったみたいな話じゃなかったっけ?w

#6 の checks を見てもらうと動いてるんですよねぇ
(何なら saitamau-maximum/blog でも動いてる)

ちゃんと動いてるからmatrix消し忘れてた

もし今後複数バージョンで動かす場合を考えて matrix を設定しておいた

@sor4chi
Copy link
Member

sor4chi commented Jul 5, 2023

https://gist.github.com/belgattitude/838b2eba30c324f1f0033a797bab2e31?permalink_comment_id=4489311
標準のキャッシュ機能よりこっちの方が早いよって話みたい

@a01sa01to
Copy link
Member Author

使い方にもよるし、現時点では「Install deps」部分が 5s しかかかってないしそこまで大差ない気はするけどなぁ...

a01sa01to added a commit that referenced this issue Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants