Skip to content

Commit

Permalink
Update GHA workflows to use Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa committed Mar 21, 2024
1 parent 959497b commit b525036
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 75 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,31 @@ on:
version:
description: 'Semver type of new version (major / minor / patch)'
required: true
type: choice
options:
- major
- minor
- patch

jobs:
bump-version:
name: Bump version
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Setup Node.js
uses: actions/setup-node@v2

- uses: oven-sh/setup-bun@v1
- run: bun install

- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'npm'
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Setup Git
run: |
node-version: "lts/*"

- run: |
git config user.name 'Sergio Xalambrí'
git config user.email '[email protected]'
- name: bump version
run: npm version ${{ github.event.inputs.version }}
- name: Push latest version
run: git push origin main --follow-tags
- run: npm version ${{ github.event.inputs.version }}
- run: git push origin main --follow-tags
71 changes: 16 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,34 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node LTS
uses: actions/setup-node@v2
with:
node-version: "lts/*"

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Build
run: npm run build
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run build

typecheck:
name: Typechecker
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node LTS
uses: actions/setup-node@v2
with:
node-version: "lts/*"

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Typecheck
run: npm run typecheck
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run typecheck

test:
name: Unit and Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node LTS
uses: actions/setup-node@v2
with:
node-version: "lts/*"

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Test
run: npm run test -- --coverage
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run test

lint:
name: Linter
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node LTS
uses: actions/setup-node@v2
with:
node-version: "lts/*"

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Build
run: npm run build

- name: Lint
run: npm run lint
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run lint
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ jobs:
name: "Publish to npm"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run build
- run: bun run test:exports

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
registry-url: https://registry.npmjs.org/

- run: npm install

- run: npm run build

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit b525036

Please sign in to comment.