-
Notifications
You must be signed in to change notification settings - Fork 120
104 lines (98 loc) · 3.13 KB
/
next-13.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Next.js 13.x
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC
jobs:
test-next-13:
runs-on: ubuntu-latest
name: Next.js 13
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Create Next.js project
run: |
npx create-next-app@13 test-app --typescript --eslint --tailwind --app --src-dir --use-npm --no-experimental-app
cd test-app
- name: Install gluestack-ui
working-directory: test-app
run: |
npx gluestack-ui init --template-only --projectType nextjs
npx gluestack-ui add --all
- name: Rename original next.config file
working-directory: test-app
run: mv next.config.js next.config.original.js
- name: Create new next.config file
working-directory: test-app
run: |
cat <<EOT > next.config.js
const originalConfig = require('./next.config.original.js');
/** @type {import('next').NextConfig} */
const nextConfig = {
...originalConfig,
typescript: {
ignoreBuildErrors: true,
},
};
module.exports = nextConfig;
EOT
- name: Add Button component
working-directory: test-app
run: |
cat <<EOT > src/app/page.tsx
import {
Button,
ButtonText,
ButtonSpinner,
ButtonIcon,
ButtonGroup,
} from "@/components/ui/button"
export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<Button size="md" variant="solid" action="primary">
<ButtonText>Hello World!</ButtonText>
</Button>
</main>
)
}
EOT
- name: Build Next.js app
working-directory: test-app
env:
NEXT_TELEMETRY_DISABLED: 1
run: |
echo "{ \"extends\": \"next/core-web-vitals\", \"rules\": {} }" > .eslintrc.json
npm run build -- --no-lint
- name: Start Next.js app
working-directory: test-app
run: npm run start & sleep 10
- name: Check if button is rendered
run: |
if curl -s http://localhost:3000 | grep -q "Hello World!"; then
echo "Button found on the page"
exit 0
else
echo "Button not found on the page"
exit 1
fi
notify:
needs: test-next-13
if: always() && github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: 'Next.js 13 Test: ${{ job.status }}'
fields: repo,commit,action,eventName
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}