Skip to content

Commit

Permalink
github actions, fixed prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
vklimontovich committed Dec 11, 2023
1 parent db1aa9d commit 26e90db
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
push:
branches: [v2.0]
pull_request:
branches: [v2.0]

workflow_dispatch:

jobs:
cache-and-install:
runs-on: ubuntu-latest

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

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- uses: oven-sh/setup-bun@v1
name: Install bun
with:
version: latest

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Check code style
run: pnpm run format:check

- name: Build and test
run: pnpm run build && pnpm run test

- name: Publish canary release to NPM repository
run: pnpm canary:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
**/tsconfig.json
**/tsconfig.paths.json
**/generated/
**/.next/
**/.next/
.pnpm-store
5 changes: 4 additions & 1 deletion apps/demo.next-collect.dev/src/app/api/env/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// src/pages/api/sign-up.ts
import { NextRequest, NextResponse } from "next/server"
import { NextRequest, NextResponse, userAgent } from "next/server"
import { nextCollect } from "next-collect/server"
import { nextCollectConfig } from "@/middleware"
import { isTruish } from "@/lib/lib"
Expand Down Expand Up @@ -27,5 +27,8 @@ export async function GET(req: NextRequest, res: NextResponse) {
headers: disableDebugInfo ? undefined : sortByKey(Object.fromEntries(req.headers.entries())),
cookies: sortByKey(Object.fromEntries(req.cookies.getAll().map(c => [c.name, c.value]))),
nodeVersion: process.versions.node,
geo: req.geo,
userAgent: req.headers.get("user-agent"),
userAgentInfo: userAgent(req),
})
}

1 comment on commit 26e90db

@vercel
Copy link

@vercel vercel bot commented on 26e90db Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.