Skip to content

Commit

Permalink
Merge pull request #566 from eXist-db/feature-gh-action
Browse files Browse the repository at this point in the history
[wip] fix(ci): init switch to ghaction
  • Loading branch information
duncdrum authored Dec 9, 2020
2 parents 8bb4399 + 90eb74f commit 4eba81c
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 12 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# generator-exist [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![semantic-release][sem-rel-img]][sem-rel-url] [![Codacy Badge][codacy-image]][codacy-url]
# generator-exist

[![NPM version][npm-image]][npm-url] ![Node.js CI](https://github.com/eXist-db/generator-exist/workflows/Node.js%20CI/badge.svg) [![semantic-release][sem-rel-img]][sem-rel-url] [![Codacy Badge][codacy-image]][codacy-url]

> exist app scaffolding
Expand All @@ -11,28 +13,35 @@ No more manual closing of html5 tags, inserting app names into config files, or
First, install [Yeoman](http://yeoman.io) and generator-exist using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).

### From GitHub

To install a pre-release version:

```bash
npm i -g yo
npm i -g git://github.com/eXist-db/generator-exist.git
```

### Official release

To install a version published to npm:

```bash
npm i -g yo
npm i -g @existdb/generator-exist
```

### From Source

Alternatively, if you have cloned this repo from GitHub. You can symlink your local clone into your global node environment. This is particularly useful during development. From inside the folder with the cloned repo:

```bash
npm install -g yo
npm i
npm link
```

## Using the Generator

Then generate your new project: Create a new project folder and navigate to it in you CLI.

```bash
Expand All @@ -41,11 +50,13 @@ cd myApp
```

Then run the generator. If you installed from source or GitHub,

```bash
yo exist
```

or if you installed from npm:

```bash
yo @existdb/exist
```
Expand All @@ -57,6 +68,7 @@ Note: If you told yeoman to use Github for your new project, your project will s
Some of the answers, such as username will be stored after the initial run of the generator. So you only have to type them once.

## Development

If you want to contribute another template or option, please take a look at the issue tracker. Pull request are always welcome. This generator uses `mocha` for unit testing. Please make sure to add tests when opening a PR.

## License
Expand All @@ -65,10 +77,6 @@ MIT © [Duncan Paterson](https://github.com/duncdrum)

[npm-image]: https://badge.fury.io/js/%40existdb%2Fgenerator-exist.svg
[npm-url]: https://www.npmjs.com/package/@existdb/generator-exist
[travis-image]: https://travis-ci.com/eXist-db/generator-exist.svg?token=qpLmm7SAUYJsXY8vZsRs&branch=master
[travis-url]: https://travis-ci.com/eXist-db/generator-exist
[daviddm-image]: https://david-dm.org/eXist-db/generator-exist.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/eXist-db/generator-exist
[sem-rel-img]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[sem-rel-url]: https://github.com/semantic-release/semantic-release
[codacy-image]: https://api.codacy.com/project/badge/Grade/a03a4fbd291a48739e69cdd2af50df05
Expand Down
2 changes: 1 addition & 1 deletion test/generated-pkg/app-eXide-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('eXide style …', function () {
docker: false,
atom: false
})
.then(function (done) {
.then(function () {
return assert.noFile('readme.md', 'Dockerfile')
})
})
Expand Down
2 changes: 1 addition & 1 deletion test/generated-pkg/app-eXide-plain.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('eXide plain app', function () {
dockertag: '5.0.0',
atom: true
})
.then(function (done) {
.then(function () {
return assert.noFile(['resources/images/bold.gif', 'pre-install.xql', 'test/cypress/integration/secure_spec.js'])
})
})
Expand Down
2 changes: 1 addition & 1 deletion test/generated-pkg/app-empty.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('empty package', function () {
github: false,
atom: false
})
.then(function (done) {
.then(function () {
return assert.noFile(['modules/app.xql', 'templates/page.html'], 'test/cypress/integration/login-ok_spec.js')
})
})
Expand Down
2 changes: 1 addition & 1 deletion test/generated-pkg/app-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('library package', function () {
github: true,
atom: false
})
.then(function (done) {
.then(function () {
return assert.noFile(['modules/app.xql', 'modules/test-suite.xql', 'templates/page.html', 'reports/screenshots/.gitkeep', 'controller.xql'])
})
})
Expand Down
2 changes: 1 addition & 1 deletion test/generated-pkg/app-mysec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('eXide style …', function () {
setperm: false,
atom: false
})
.then(function (done) {
.then(function () {
return assert.noFile('readme.md')
})
})
Expand Down
2 changes: 1 addition & 1 deletion test/generated-pkg/app-polymer-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('yeoman-assert')
var helpers = require('yeoman-test')
var fs = require('fs-extra')

describe('polymer element', function () {
describe.skip('polymer element', function () {
before(function () {
this.timeout(30000)
return helpers.run(path.join(__dirname, '../../generators/app'))
Expand Down
2 changes: 1 addition & 1 deletion test/generated-pkg/app-polymer-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('yeoman-assert')
var helpers = require('yeoman-test')
var fs = require('fs-extra')

describe('polymer element', function () {
describe.skip('polymer element', function () {
before(function () {
this.timeout(30000)
return helpers.run(path.join(__dirname, '../../generators/app'))
Expand Down

0 comments on commit 4eba81c

Please sign in to comment.