Skip to content

Commit 6a9dba1

Browse files
author
Robert Jackson
authored
Add GH Actions Workflow setup to new projects. (#71)
Add GH Actions Workflow setup to new projects.
2 parents cb3218a + 5e4f07f commit 6a9dba1

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

commands/global/new.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,76 @@ module.exports.handler = async function handler(options) {
168168
- yarn coveralls
169169
`
170170
);
171+
fs.outputFileSync(
172+
projectName + '/.github/workflows/ci.yml',
173+
stripIndent`
174+
name: CI
175+
176+
on:
177+
push:
178+
branches:
179+
- master
180+
- 'v*' # older version branches
181+
tags:
182+
- '*'
183+
pull_request: {}
184+
schedule:
185+
- cron: '0 6 * * 0' # weekly, on sundays
186+
187+
jobs:
188+
lint:
189+
name: Linting
190+
runs-on: ubuntu-latest
191+
192+
steps:
193+
- uses: actions/checkout@v1
194+
- uses: actions/setup-node@v1
195+
with:
196+
node-version: 12.x
197+
- name: install yarn
198+
run: npm install -g yarn
199+
- name: install dependencies
200+
run: yarn install
201+
- name: linting
202+
run: yarn lint
203+
204+
test:
205+
name: Tests
206+
runs-on: ubuntu-latest
207+
208+
strategy:
209+
matrix:
210+
node: ['^8.12.0', '10', '12']
211+
212+
steps:
213+
- uses: actions/checkout@v1
214+
- uses: actions/setup-node@v1
215+
with:
216+
node-version: \${{ matrix.node }}
217+
- name: install yarn
218+
run: npm install --global yarn
219+
- name: install dependencies
220+
run: yarn
221+
- name: test
222+
run: yarn test
223+
224+
floating-test:
225+
name: Floating dependencies
226+
runs-on: ubuntu-latest
227+
228+
steps:
229+
- uses: actions/checkout@v1
230+
- uses: actions/setup-node@v1
231+
with:
232+
node-version: '12.x'
233+
- name: install yarn
234+
run: npm install -g yarn
235+
- name: install dependencies
236+
run: yarn install --no-lockfile
237+
- name: test
238+
run: yarn test
239+
`
240+
);
171241
fs.outputFileSync(
172242
projectName + '/bin/cli.js',
173243
stripIndent`

tests/cli-test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ QUnit.module('codemod-cli', function(hooks) {
5555
'ember-qunit-codemod/',
5656
'ember-qunit-codemod/.eslintignore',
5757
'ember-qunit-codemod/.eslintrc.js',
58+
'ember-qunit-codemod/.github/',
59+
'ember-qunit-codemod/.github/workflows/',
60+
'ember-qunit-codemod/.github/workflows/ci.yml',
5861
'ember-qunit-codemod/.gitignore',
5962
'ember-qunit-codemod/.prettierrc',
6063
'ember-qunit-codemod/.travis.yml',

0 commit comments

Comments
 (0)