Skip to content
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

Add ci script to check examples #28009

Merged
merged 11 commits into from Aug 14, 2021
10 changes: 10 additions & 0 deletions .github/workflows/build_test_deploy.yml
Expand Up @@ -8,6 +8,16 @@ on:
name: Build, test, and deploy

jobs:
check-examples:
name: Check examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install moreutils
run: sudo apt install moreutils
- name: Check examples
run: ./scripts/check-examples.sh

build:
runs-on: ubuntu-latest
env:
Expand Down
2 changes: 0 additions & 2 deletions examples/with-cypress/package.json
@@ -1,6 +1,4 @@
{
"name": "with-cypress",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
3 changes: 0 additions & 3 deletions examples/with-fauna/package.json
@@ -1,8 +1,5 @@
{
"private": true,
"name": "with-fauna",
"version": "1.0.0",
"description": "Guestbook example with Next.js and Fauna.",
"scripts": {
"dev": "next",
"build": "yarn setup && next build",
Expand Down
3 changes: 3 additions & 0 deletions examples/with-jotai/next-env.d.ts
@@ -1,3 +1,6 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
1 change: 0 additions & 1 deletion examples/with-jotai/package.json
@@ -1,5 +1,4 @@
{
"name": "with-jotai",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
5 changes: 4 additions & 1 deletion scripts/check-examples.sh
Expand Up @@ -3,7 +3,10 @@
for folder in examples/* ; do
if [ -f "$folder/package.json" ]; then
cp -n packages/create-next-app/templates/default/gitignore $folder/.gitignore;
cat $folder/package.json | jq 'del(.license) | .private = true' | sponge $folder/package.json
cat $folder/package.json | jq '
.private = true |
del(.license, .version, .name, .author, .description)
' | sponge $folder/package.json
fi
if [ -f "$folder/tsconfig.json" ]; then
cp packages/create-next-app/templates/typescript/next-env.d.ts $folder/next-env.d.ts
Expand Down