Skip to content

Commit

Permalink
chore(ci): make runs faster (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt authored Mar 11, 2023
1 parent 8a98925 commit be7e6b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
17 changes: 11 additions & 6 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,24 @@ runs:
echo "PnPM version is $(pnpm --version)"
shell: bash
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- name: Get Current Month
id: date-month
shell: bash
run: |
DATE=$(date +'%Y-%m')
echo "$DATE"
echo "date_month=$DATE" >> $GITHUB_OUTPUT
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
key: ${{ runner.os }}-pnpm-store-${{steps.date-month.outputs.date_month}}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-${{steps.date-month.outputs.date_month}}
- name: Install Dependencies
run: pnpm install
shell: bash
if: ${{inputs.install-deps}} == 'true'
11 changes: 1 addition & 10 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,19 @@ name: pr
on:
pull_request: {}
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
format:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: pnpm check:format
types:
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: pnpm check:types

tests:
needs: setup
test:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down

0 comments on commit be7e6b2

Please sign in to comment.