Skip to content

Commit

Permalink
chore: ci caching etc
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Aug 29, 2022
1 parent 1fbcfe1 commit 3d605ed
Show file tree
Hide file tree
Showing 20 changed files with 259 additions and 78 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

38 changes: 0 additions & 38 deletions .eslintrc

This file was deleted.

27 changes: 27 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
plugins: ["unicorn", "turbo"],
extends: [
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:prettier/recommended",
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of import
project: "./tsconfig.eslint.json", // Allows for the use of rules which require parserServices to be generated
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-floating-promises": "error",
"unicorn/filename-case": [
"error",
{
case: "camelCase",
},
],
"prettier/prettier": ["error", { endOfLine: "auto" }],
},
};
30 changes: 16 additions & 14 deletions .github/workflows/PR-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ on:
branches: ["*"]

jobs:
lint-pr:
runs-on: ubuntu-latest
name: Lint the PR title
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

install-deps:
runs-on: ubuntu-latest
name: Run pnpm install
Expand All @@ -17,7 +25,7 @@ jobs:
- uses: actions/cache@v3
id: pnpm-cache
with:
path: "**/node_modules"
path: "./node_modules/.cache/turbo"
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-
Expand All @@ -40,7 +48,7 @@ jobs:
- name: Load node_modules
uses: actions/cache@v3
with:
path: "**/node_modules"
path: "./node_modules/.cache/turbo"
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Restore ESLint Cache
uses: actions/cache@v3
Expand All @@ -56,15 +64,6 @@ jobs:
node-version: 16
- run: pnpm lint

lint-pr:
runs-on: ubuntu-latest
name: Lint the PR title
needs: install-deps
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

prettier:
runs-on: ubuntu-latest
name: Run Prettier Check
Expand All @@ -74,7 +73,7 @@ jobs:
- name: Load node_modules
uses: actions/cache@v3
with:
path: "**/node_modules"
path: "./node_modules/.cache/turbo"
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v2.2.2
with:
Expand All @@ -93,7 +92,7 @@ jobs:
- name: Load node_modules
uses: actions/cache@v3
with:
path: "**/node_modules"
path: "./node_modules/.cache/turbo"
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v2.2.2
with:
Expand All @@ -112,7 +111,7 @@ jobs:
- name: Load node_modules
uses: actions/cache@v3
with:
path: "**/node_modules"
path: "./node_modules/.cache/turbo"
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v2.2.2
with:
Expand All @@ -130,6 +129,9 @@ jobs:
runs-on: ubuntu-latest
# We explicitely build this in GHA & Vercel since Vercel doesn't seem to catch some errors
# meaning the www might be deployed even with errors
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
name: Build www
needs: install-deps
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ temp/
.DS_Store
Thumbs.db

.vscode
.vscode.turbo
9 changes: 9 additions & 0 deletions cli/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
root: true,
extends: ["../.eslintrc.cjs"],
parserOptions: {
ecmaVersion: "latest", // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of import
project: "./tsconfig.json", // Allows for the use of rules which require parserServices to be generated
},
};
1 change: 1 addition & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"dev": "tsup src/index.ts --format esm --watch --clean --onSuccess \"node dist/index.js\"",
"start": "node dist/index.js",
"check": "pnpm lint && pnpm format:check && pnpm typecheck",
"lint": "eslint src --cache --cache-strategy content",
"release": "changeset version",
"pub:beta": "pnpm build && npm publish --tag beta",
"pub:next": "pnpm build && npm publish --tag next",
Expand Down
2 changes: 1 addition & 1 deletion cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"~/*": ["./src/*"]
}
},
"include": ["src"]
"include": ["src", ".eslintrc.cjs"]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
"dev:cli": "pnpm --filter create-t3-app dev",
"dev:www": "turbo run dev --filter=www",
"clean": "find . -name node_modules -o -name .turbo -o -name dist -o -name build -type d -prune | xargs rm -rf",
"lint": "eslint . --cache --cache-strategy content",
"lint:fix": "pnpm lint --fix",
"lint": "turbo run lint",
"format": "prettier --write --plugin-search-dir=. \"**/*.{ts,tsx,md,mdx,json,js,mjs,cjs,astro}\"",
"format:check": "prettier --check --plugin-search-dir=. \"**/*.{ts,tsx,md,mdx,json,js,mjs,cjs,astro}\"",
"check": "pnpm lint && pnpm format:check && pnpm typecheck",
Expand All @@ -55,6 +54,7 @@
"@typescript-eslint/parser": "^5.35.1",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-turbo": "^0.0.3",
"eslint-plugin-no-only-tests": "^2.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.0",
Expand Down
Loading

0 comments on commit 3d605ed

Please sign in to comment.