Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 1cfe0d4

Browse files
authored
feat: Add CircleCI and Travis CI (#737)
1 parent f4d543b commit 1cfe0d4

File tree

6 files changed

+258
-1
lines changed

6 files changed

+258
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ yarn create nuxt-app <my-project>
8080
- [Dependabot (for GitHub only)](https://dependabot.com/)
8181
1. Continous Integration
8282
- [GitHub Actions](https://github.com/features/actions)
83+
- [Travis CI](https://travis-ci.com)
84+
- [CircleCI](https://circleci.com)
8385

8486
## CLI Options
8587

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
version: 2
2+
3+
jobs:
4+
ci:
5+
docker:
6+
- image: cimg/node:lts
7+
steps:
8+
- checkout
9+
10+
- restore_cache:
11+
keys:
12+
<%_ if (pm === 'npm') { _%>
13+
- node-v1-{{ checksum "package-lock.json" }}
14+
<%_ } _%>
15+
<%_ if (pm === 'yarn') { _%>
16+
- yarn-v1-{{ checksum "yarn.lock" }}
17+
<%_ } _%>
18+
19+
- run:
20+
name: Install dependencies
21+
command: <%= pm === 'yarn' ? 'yarn --frozen-lockfile --cache-folder ~/.cache/yarn': 'npm ci' %>
22+
23+
- save_cache:
24+
<%_ if (pm === 'npm') { _%>
25+
key: node-v1-{{ checksum "package-lock.json" }}
26+
paths:
27+
- ~/.npm
28+
<%_ } _%>
29+
<%_ if (pm === 'yarn') { _%>
30+
key: yarn-v1-{{ checksum "yarn.lock" }}
31+
paths:
32+
- ~/.cache/yarn
33+
<%_ } _%>
34+
35+
<%_ if (linter.length > 0) { _%>
36+
- run:
37+
name: Run linter
38+
command: <%= pmRun %> lint
39+
<%_ } _%>
40+
41+
<%_ if (test !== 'none') { _%>
42+
- run:
43+
name: Run tests
44+
command: <%= pmRun %> test
45+
<%_ } _%>
46+
47+
workflows:
48+
version: 2
49+
ci:
50+
jobs:
51+
- ci:
52+
filters:
53+
branches:
54+
only:
55+
- main
56+
- master
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: node_js
2+
node_js:
3+
- lts/*
4+
5+
os:
6+
- linux
7+
dist: focal
8+
9+
branches:
10+
only:
11+
- main
12+
- master
13+
14+
<%_ if (pm === 'yarn') { _%>
15+
cache: yarn
16+
<%_ } _%>
17+
<%_ if (pm === 'npm') { _%>
18+
cache: npm
19+
<%_ } _%>
20+
21+
script:
22+
<%_ if (linter.length > 0) { _%>
23+
- <%= pmRun %> lint
24+
<%_ } _%>
25+
<%_ if (test !== 'none') { _%>
26+
- <%= pmRun %> test
27+
<%_ } _%>

packages/create-nuxt-app/lib/prompts.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ module.exports = [
125125
type: 'list',
126126
choices: [
127127
{ name: 'None', value: 'none' },
128-
{ name: 'GitHub Actions (GitHub only)', value: 'github-actions' }
128+
{ name: 'GitHub Actions (GitHub only)', value: 'github-actions' },
129+
{ name: 'Travis CI', value: 'travis-ci' },
130+
{ name: 'CircleCI', value: 'circleci' }
129131
],
130132
default: 'none'
131133
},

packages/create-nuxt-app/test/snapshots/index.test.js.md

+170
Original file line numberDiff line numberDiff line change
@@ -4024,6 +4024,176 @@ Generated by [AVA](https://avajs.dev).
40244024

40254025
## verify ci: GitHub Actions (GitHub only)
40264026

4027+
> Generated files
4028+
4029+
[
4030+
'.editorconfig',
4031+
'.gitignore',
4032+
'README.md',
4033+
'assets/README.md',
4034+
'components/Logo.vue',
4035+
'components/README.md',
4036+
'layouts/README.md',
4037+
'layouts/default.vue',
4038+
'middleware/README.md',
4039+
'nuxt.config.js',
4040+
'package.json',
4041+
'pages/README.md',
4042+
'pages/index.vue',
4043+
'plugins/README.md',
4044+
'static/README.md',
4045+
'static/favicon.ico',
4046+
'store/README.md',
4047+
]
4048+
4049+
> package.json
4050+
4051+
{
4052+
dependencies: {
4053+
'core-js': '^3.9.1',
4054+
nuxt: '^2.15.2',
4055+
},
4056+
devDependencies: {},
4057+
private: true,
4058+
scripts: {
4059+
build: 'nuxt build',
4060+
dev: 'nuxt',
4061+
generate: 'nuxt generate',
4062+
start: 'nuxt start',
4063+
},
4064+
}
4065+
4066+
> Generated nuxt.config.js
4067+
4068+
`export default {␊
4069+
// Global page headers: https://go.nuxtjs.dev/config-head␊
4070+
head: {␊
4071+
title: 'output',␊
4072+
htmlAttrs: {␊
4073+
lang: 'en'␊
4074+
},␊
4075+
meta: [␊
4076+
{ charset: 'utf-8' },␊
4077+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },␊
4078+
{ hid: 'description', name: 'description', content: '' }␊
4079+
],␊
4080+
link: [␊
4081+
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }␊
4082+
]␊
4083+
},␊
4084+
4085+
// Global CSS: https://go.nuxtjs.dev/config-css␊
4086+
css: [␊
4087+
],␊
4088+
4089+
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins␊
4090+
plugins: [␊
4091+
],␊
4092+
4093+
// Auto import components: https://go.nuxtjs.dev/config-components␊
4094+
components: true,␊
4095+
4096+
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules␊
4097+
buildModules: [␊
4098+
],␊
4099+
4100+
// Modules: https://go.nuxtjs.dev/config-modules␊
4101+
modules: [␊
4102+
],␊
4103+
4104+
// Build Configuration: https://go.nuxtjs.dev/config-build␊
4105+
build: {␊
4106+
}␊
4107+
}␊
4108+
`
4109+
4110+
## verify ci: Travis CI
4111+
4112+
> Generated files
4113+
4114+
[
4115+
'.editorconfig',
4116+
'.gitignore',
4117+
'README.md',
4118+
'assets/README.md',
4119+
'components/Logo.vue',
4120+
'components/README.md',
4121+
'layouts/README.md',
4122+
'layouts/default.vue',
4123+
'middleware/README.md',
4124+
'nuxt.config.js',
4125+
'package.json',
4126+
'pages/README.md',
4127+
'pages/index.vue',
4128+
'plugins/README.md',
4129+
'static/README.md',
4130+
'static/favicon.ico',
4131+
'store/README.md',
4132+
]
4133+
4134+
> package.json
4135+
4136+
{
4137+
dependencies: {
4138+
'core-js': '^3.9.1',
4139+
nuxt: '^2.15.2',
4140+
},
4141+
devDependencies: {},
4142+
private: true,
4143+
scripts: {
4144+
build: 'nuxt build',
4145+
dev: 'nuxt',
4146+
generate: 'nuxt generate',
4147+
start: 'nuxt start',
4148+
},
4149+
}
4150+
4151+
> Generated nuxt.config.js
4152+
4153+
`export default {␊
4154+
// Global page headers: https://go.nuxtjs.dev/config-head␊
4155+
head: {␊
4156+
title: 'output',␊
4157+
htmlAttrs: {␊
4158+
lang: 'en'␊
4159+
},␊
4160+
meta: [␊
4161+
{ charset: 'utf-8' },␊
4162+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },␊
4163+
{ hid: 'description', name: 'description', content: '' }␊
4164+
],␊
4165+
link: [␊
4166+
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }␊
4167+
]␊
4168+
},␊
4169+
4170+
// Global CSS: https://go.nuxtjs.dev/config-css␊
4171+
css: [␊
4172+
],␊
4173+
4174+
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins␊
4175+
plugins: [␊
4176+
],␊
4177+
4178+
// Auto import components: https://go.nuxtjs.dev/config-components␊
4179+
components: true,␊
4180+
4181+
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules␊
4182+
buildModules: [␊
4183+
],␊
4184+
4185+
// Modules: https://go.nuxtjs.dev/config-modules␊
4186+
modules: [␊
4187+
],␊
4188+
4189+
// Build Configuration: https://go.nuxtjs.dev/config-build␊
4190+
build: {␊
4191+
}␊
4192+
}␊
4193+
`
4194+
4195+
## verify ci: CircleCI
4196+
40274197
> Generated files
40284198
40294199
[
Binary file not shown.

0 commit comments

Comments
 (0)