Skip to content

Commit be7e6b2

Browse files
authored
chore(ci): make runs faster (#478)
1 parent 8a98925 commit be7e6b2

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

.github/actions/setup/action.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,24 @@ runs:
2222
echo "PnPM version is $(pnpm --version)"
2323
shell: bash
2424
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
25+
- name: Get Current Month
26+
id: date-month
27+
shell: bash
28+
run: |
29+
DATE=$(date +'%Y-%m')
30+
echo "$DATE"
31+
echo "date_month=$DATE" >> $GITHUB_OUTPUT
2532
- name: Get pnpm store directory
2633
id: pnpm-cache
2734
shell: bash
28-
run: |
29-
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
35+
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
3036
- uses: actions/cache@v3
3137
name: Setup pnpm cache
3238
with:
3339
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
34-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
35-
restore-keys: |
36-
${{ runner.os }}-pnpm-store-
37-
- name: Install dependencies
40+
key: ${{ runner.os }}-pnpm-store-${{steps.date-month.outputs.date_month}}-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: ${{ runner.os }}-pnpm-store-${{steps.date-month.outputs.date_month}}
42+
- name: Install Dependencies
3843
run: pnpm install
3944
shell: bash
4045
if: ${{inputs.install-deps}} == 'true'

.github/workflows/pr.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,19 @@ name: pr
22
on:
33
pull_request: {}
44
jobs:
5-
setup:
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v3
9-
- uses: ./.github/actions/setup
105
format:
11-
needs: setup
126
runs-on: ubuntu-latest
137
steps:
148
- uses: actions/checkout@v3
159
- uses: ./.github/actions/setup
1610
- run: pnpm check:format
1711
types:
18-
needs: setup
1912
runs-on: ubuntu-latest
2013
steps:
2114
- uses: actions/checkout@v3
2215
- uses: ./.github/actions/setup
2316
- run: pnpm check:types
24-
25-
tests:
26-
needs: setup
17+
test:
2718
runs-on: ubuntu-latest
2819
strategy:
2920
matrix:

0 commit comments

Comments
 (0)