Skip to content

Commit

Permalink
Reorder CI jobs and improve pnpm setup
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-hiller committed Oct 16, 2023
1 parent cafe9b9 commit 66be71d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ runs:
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install packages
shell: 'bash'
shell: bash
run: pnpm install
55 changes: 22 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,84 +9,73 @@ jobs:
install:
name: Install packages
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm

lint_website:
name: Run ESLint in website
library_prettier:
name: Run Prettier in library
needs: install
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm
- name: Prettier check
run: pnpm format.check
working-directory: library

- name: ESLint check
run: pnpm lint
working-directory: website

format_website:
name: Run Prettier in website
library_eslint:
name: Run ESLint in library
needs: install
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm
- name: ESLint check
run: pnpm lint
working-directory: library

- name: Prettier check
run: pnpm format.check
working-directory: website

lint_library:
name: Run ESLint in library
library_vitest:
name: Run Vitest in library
needs: install
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm

- name: ESLint check
run: pnpm lint
- name: Vitest tests
run: pnpm test
working-directory: library

format_library:
name: Run Prettier in library
website_prettier:
name: Run Prettier in website
needs: install
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm

- name: Prettier check
run: pnpm format.check
working-directory: library
working-directory: website

test_library:
name: Run Vitest in library
website_eslint:
name: Run ESLint in website
needs: install
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm

- name: Vitest tests
run: pnpm test
working-directory: library
- name: ESLint check
run: pnpm lint
working-directory: website

0 comments on commit 66be71d

Please sign in to comment.