Skip to content

Commit

Permalink
👷 Update actions to use bun
Browse files Browse the repository at this point in the history
  • Loading branch information
mariush2 committed Dec 17, 2024
1 parent c99d200 commit d20b70d
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 65 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [21.x]

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

- name: Use bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: npm ci
run: bun install --frozen-lockfile

- name: Build
run: npm run build
run: bun run build
21 changes: 13 additions & 8 deletions .github/workflows/build_storybook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@ jobs:
build-storybook:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [21.x]

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

- name: Use bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: npm ci
run: bun install --frozen-lockfile

- name: Build
run: npm run build-storybook
run: bun run build-storybook

build-storybook-with-docker:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build the docker image
run: docker build . --file Dockerfile
31 changes: 21 additions & 10 deletions .github/workflows/code_coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
name: Test
name: "Coverage"

on:
workflow_call:

jobs:
code-coverage:
coverage:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [21.x]
permissions:
# Required to checkout the code
contents: read
# Required to put a comment into the pull-request
pull-requests: write

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

- name: Use bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: npm ci
run: bun install --frozen-lockfile

- name: "Check coverage"
run: bun run test:coverage-ci

- name: Unit tests
run: npm run test:coverage
- name: 'Report Coverage'
# Set if: always() to also generate the report if tests are failing
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
18 changes: 18 additions & 0 deletions .github/workflows/eslint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: ESLint
on:
workflow_call:
jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Linting
run: bun run lint
21 changes: 0 additions & 21 deletions .github/workflows/lint.yaml

This file was deleted.

13 changes: 7 additions & 6 deletions .github/workflows/npm_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ permissions:
jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 21.x

- name: Use bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: npm ci
run: bun install --frozen-lockfile

- name: Run Tests
run: npm run test:ci
run: bun run test:ci

- name: Build Components
run: npm run build
run: bun run build-components

- uses: JS-DevTools/npm-publish@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
- ".github/workflows/**"
workflow_dispatch:
jobs:
lint:
name: Lint
uses: ./.github/workflows/lint.yaml
eslint:
name: ESLint
uses: ./.github/workflows/eslint.yaml

test:
name: Test
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [21.x]

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

- name: Use bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: npm ci
run: bun install --frozen-lockfile

- name: Unit tests
run: npm run test:ci
- name: Tests
run: bun run test:ci

0 comments on commit d20b70d

Please sign in to comment.