Skip to content

Commit

Permalink
ci: update github workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
mvantellingen committed Jan 11, 2025
1 parent 56f4e4b commit 6407c70
Showing 1 changed file with 69 additions and 30 deletions.
99 changes: 69 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,79 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2.2.2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 8
version: 9
run_install: false

- name: Set up Node.js
uses: actions/setup-node@v3
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
name: Setup pnpm cache
with:
node-version: 18
cache: "pnpm"
path: ${{ steps.pnpm-cache.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Run PNPM install
run: pnpm install --frozen-lockfile
- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint
- name: Check formatting and typing
run: pnpm check

build:
name: Build, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: lint
strategy:
matrix:
node: ["16.x", "18.x", "20.x"]
node: ["20.x", "22.x"]
os: [ubuntu-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 8
version: 9
run_install: false

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v3
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
name: Setup pnpm cache
with:
node-version: ${{ matrix.node }}
cache: "pnpm"
path: ${{ steps.pnpm-cache.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Run PNPM install
run: pnpm install --frozen-lockfile
- name: Install dependencies
run: pnpm install

- name: Test
run: pnpm run test:ci
Expand All @@ -71,24 +97,37 @@ jobs:
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2.2.2
- name: Install node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 8
version: 9
run_install: false

- name: Install node.js
uses: actions/setup-node@v3
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
name: Setup pnpm cache
with:
node-version: 18
cache: "pnpm"
path: ${{ steps.pnpm-cache.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Run PNPM install
run: pnpm install --frozen-lockfile
- name: Install dependencies
run: pnpm install

- name: Create and publish versions
uses: changesets/action@v1
Expand Down

0 comments on commit 6407c70

Please sign in to comment.