Skip to content

chore: CI stuff #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*
- run: pnpm install
- run: pnpm lint
- run: pnpm type-check
33 changes: 15 additions & 18 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Prettier

on:
push:
branches: [main]
branches: [main, scratchpad]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
branches: [main, scratchpad]
branches: [main]

workflow_dispatch:

concurrency:
Expand All @@ -15,31 +15,28 @@ jobs:
name: Can the code be prettier? 🤔
runs-on: ubuntu-latest
# workflow_dispatch always lets you select the branch ref, even though in this case we only ever want to run the action on `main` this we need an if check
if: ${{ github.ref_name == 'main' }}
# if: ${{ github.ref_name == 'main' }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: npm
cache: pnpm
node-version: lts/*
- run: npm ci --ignore-scripts --only-dev
- uses: actions/cache@v3
with:
path: node_modules/.cache/prettier/.prettier-cache
key: prettier-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.gitignore') }}
- run: npx prettier --ignore-path .gitignore --cache --write .
- run: pnpm install
- run: pnpm format
- run: git restore .github/workflows
- uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2
- uses: actions/create-github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.ECOSPARK_APP_ID }}
private_key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
- uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6
app-id: ${{ secrets.ECOSPARK_APP_ID }}
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
with:
author: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
body: I ran `npx prettier --ignore-path .gitignore --cache --write .` 🧑‍💻
branch: actions/prettier-if-needed
commit-message: 'chore(prettier): 🤖 ✨'
body: I ran `pnpm format` 🧑‍💻
branch: actions/prettier
commit-message: "chore(prettier): 🤖 ✨"
labels: 🤖 bot
title: 'chore(prettier): 🤖 ✨'
sign-commits: true
title: "chore(prettier): 🤖 ✨"
token: ${{ steps.generate-token.outputs.token }}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist = true
1 change: 1 addition & 0 deletions nextjs-app/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "nextjs-app",
"private": true,
"scripts": {
"predev": "npm run typegen",
Expand Down
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"scripts": {
"lint": "pnpm -r lint",
"type-check": "pnpm -r type-check",
"format": "prettier --cache --write ."
},
"prettier": "@sanity/prettier-config",
"packageManager": "[email protected]",
"dependencies": {
"@sanity/prettier-config": "^1.0.3",
"prettier": "^3.3.3"
}
}
Loading