Skip to content

Commit

Permalink
Add GitHub actions (#1)
Browse files Browse the repository at this point in the history
* feat: format all files

* ci: add github actions

* ci: add validate translations

* fix: form tests

* fix: rename job
  • Loading branch information
matejm authored May 14, 2024
1 parent 7bffa97 commit 1d0c843
Show file tree
Hide file tree
Showing 18 changed files with 5,812 additions and 4,067 deletions.
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# PR description :hammer:

Explain (in few sentences or bullet points) what has been done

## Author checklist :white_check_mark:

- [ ] :ticket: PR has been linked to Jira ticket
- [ ] :hourglass: Time has been tracked in Jira
18 changes: 18 additions & 0 deletions .github/workflows/i18n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: i18n
on:
# Only run on PRs into master
pull_request:
branches:
- master

jobs:
i18n:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: true
- name: Check Localization
run: |
pnpm i18n
36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint
on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: true
- name: Lint
run: |
pnpm lint
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: true
- name: Typecheck
run: |
pnpm tsc
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: true
- name: Run prettier
run: |
pnpm format
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Test'
on:
pull_request:
workflow_dispatch:
jobs:
test:
permissions:
checks: write
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: |
pnpm test
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ next-env.d.ts

# husky
/.husky/

# Ignore autogenerated files
.infisical.json
components.json
1 change: 0 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,3 @@ Customize and configure your Next.js project to match your preferences and proje
### 📦 UI Components Configuration

- **shadcn/ui**: Modify the `components.json` to configure or extend the UI components provided by `shadcn/ui`.

78 changes: 41 additions & 37 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
import {withSentryConfig} from '@sentry/nextjs';
import { withSentryConfig } from '@sentry/nextjs';
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default withSentryConfig(nextConfig, {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: true,
org: "zerodays",
project: "nextjs-template",
}, {
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
// tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors.
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
});
export default withSentryConfig(
nextConfig,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: true,
org: 'zerodays',
project: 'nextjs-template',
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
// tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors.
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
},
);
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "nextjs-template",
"version": "0.1.0",
"private": true,
"packageManager": "pnpm@9.1.0",
"scripts": {
"dev": "infisical run -- next dev",
"build": "next build",
Expand All @@ -11,7 +12,8 @@
"format": "prettier --check --ignore-path .prettierignore .",
"format:fix": "prettier --write --ignore-path .prettierignore .",
"test": "jest",
"test:watch": "jest --watch"
"test:watch": "jest --watch",
"i18n": "tsx ./scripts/validate-translations.ts"
},
"dependencies": {
"@hookform/resolvers": "^3.3.4",
Expand Down Expand Up @@ -69,6 +71,7 @@
"prettier-plugin-tailwindcss": "^0.5.14",
"tailwindcss": "^3.4.1",
"ts-node": "^10.9.2",
"tsx": "^4.10.2",
"typescript": "^5.4.5",
"typescript-eslint": "^7.8.0"
},
Expand Down
Loading

0 comments on commit 1d0c843

Please sign in to comment.