Skip to content

Commit

Permalink
Change to Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa committed Dec 5, 2024
1 parent f47516a commit 416e3a7
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 7,925 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,33 @@ on:
workflow_dispatch:
inputs:
version:
description: "Semver type of new version (major / minor / patch)"
description: "Type of version to bump"
required: true
type: choice
options:
- major
- minor
- patch

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

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

- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile

- 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 'hello@sergiodxa.com'
- 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
101 changes: 32 additions & 69 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,86 +1,49 @@
name: CI

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on: [push]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Use Node LTS
uses: actions/setup-node@v4
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@v2
- run: bun install --frozen-lockfile
- run: bun run build

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

- name: Use Node LTS
uses: actions/setup-node@v4
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@v2
- run: bun install --frozen-lockfile
- run: bun run typecheck

# quality:
# name: Code Quality
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: oven-sh/setup-bun@v2
# - run: bun install --frozen-lockfile
# - run: bun run quality

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

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

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

- name: Test
run: npm run test -- --coverage

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

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

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

- name: Lint
run: npm run lint
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun test

# exports:
# name: Verify Exports
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: oven-sh/setup-bun@v2
# - run: bun install --frozen-lockfile
# - run: bun run exports
9 changes: 3 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,21 @@ on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

jobs:
publish-npm:
name: "Publish to npm"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun run build

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

- run: npm install

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Binary file added bun.lockb
Binary file not shown.
Loading

0 comments on commit 416e3a7

Please sign in to comment.