Skip to content

Commit

Permalink
Merge a664460 into 0ba3d68
Browse files Browse the repository at this point in the history
  • Loading branch information
pebie committed Jan 11, 2022
2 parents 0ba3d68 + a664460 commit 49c9d45
Show file tree
Hide file tree
Showing 19 changed files with 2,626 additions and 2,266 deletions.
100 changes: 53 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,56 @@
# 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: Continuous integration

name: Node.js CI

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

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
cucumber-version: [7.x, 8.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: yarn add -P @cucumber/cucumber@${{ matrix.cucumber-version }}
- run: yarn run lint
- run: yarn run check-fmt
- run: yarn run check-readme
- run: yarn run test-cover
- run: yarn run test-cli
- run: yarn run examples --tags @offline
- name: Coveralls Parallel
env:
COVERALLS_FLAG_NAME: run-${{ matrix.node-version }}-${{ matrix.cucumber-version }}
uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.github_token }}
parallel: true

coverall:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
cucumber-version: [7.x, 8.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install

- name: Eslint
run: yarn lint

- name: Prettier
run: yarn check-fmt

- name: Tests
run: yarn test-cli

- name: Coverage
run: yarn test-cover

- name: Coveralls Parallel
env:
COVERALLS_FLAG_NAME: run-${{ matrix.node-version }}-${{ matrix.cucumber-version }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true

coverall:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v1.1.1
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
release-type: node
package-name: "@ekino/veggies"
command: github-release
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
default-branch: main
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ _doc

# yarn
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

!bin/veggies.js
events.json
77 changes: 0 additions & 77 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

367 changes: 367 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

Large diffs are not rendered by default.

631 changes: 631 additions & 0 deletions .yarn/releases/yarn-3.0.2.cjs

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions .yarn/sdks/eslint/lib/api.js

This file was deleted.

6 changes: 0 additions & 6 deletions .yarn/sdks/eslint/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions .yarn/sdks/integrations.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/prettier/index.js

This file was deleted.

6 changes: 0 additions & 6 deletions .yarn/sdks/prettier/package.json

This file was deleted.

6 changes: 5 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
yarnPath: .yarn/releases/yarn-3.1.0.cjs
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.0.2.cjs
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,3 @@
* docs(post): add documentation about posting data ([fe2625e](https://github.com/ekino/veggies/commit/fe2625e))
* docs(toc): improve README TOC ([b8c11c9](https://github.com/ekino/veggies/commit/b8c11c9))
* docs(type system): add documentation about type system ([e854a25](https://github.com/ekino/veggies/commit/e854a25))



57 changes: 0 additions & 57 deletions Makefile

This file was deleted.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"babylon": "6.x",
"chalk": "4.x",
"commitlint": "12.x",
"conventional-changelog": "^3.1.24",
"conventional-changelog-cli": "2.x",
"coveralls": "3.x",
"eslint": "7.x",
Expand All @@ -69,7 +70,6 @@
"test": "jest --verbose --colors tests",
"test-cover": "jest --verbose --colors --coverage",
"test-cli": "veggies --require tests/cli/support tests/cli/features",
"coverage": "cat ./coverage/lcov.info | coveralls",
"fmt": "prettier --print-width 100 --tab-width=4 --single-quote --bracket-spacing --no-semi --color --write \"{src,tests,scripts}/**/*.js\"",
"check-fmt": "prettier --print-width 100 --tab-width=4 --single-quote --bracket-spacing --no-semi --list-different \"{src,tests,scripts}/**/*.js\"",
"lint": "eslint .",
Expand All @@ -78,7 +78,6 @@
"check-readme": "node scripts/generate_readme --check",
"doc": "jsdoc -c .jsdoc.json --verbose",
"doc-pub": "yarn run readme && yarn run doc && gh-pages -d _doc",
"examples": "veggies --require examples/support examples/features",
"changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s"
"examples": "veggies --require examples/support examples/features"
}
}
12 changes: 6 additions & 6 deletions src/extensions/cli/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ exports.install = () => {
this.cli.setCwd(cwd)
})

Given(/^(?:I )?set ([^ ]+) (?:env|environment) (?:var|variable) to (.+)$/, function (
name,
value
) {
this.cli.setEnvironmentVariable(name, value)
})
Given(
/^(?:I )?set ([^ ]+) (?:env|environment) (?:var|variable) to (.+)$/,
function (name, value) {
this.cli.setEnvironmentVariable(name, value)
}
)

Given(/^(?:I )?set (?:env|environment) (?:vars|variables)$/, function (step) {
this.cli.setEnvironmentVariables(step.rowsHash())
Expand Down
57 changes: 28 additions & 29 deletions src/extensions/file_system/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,34 @@ exports.install = () => {
/**
* Checking file content.
*/
Then(/^file (.+) content should (not )?(equal|contain|match) (.+)$/, function (
file,
flag,
comparator,
expectedValue
) {
return this.fileSystem
.getFileContent(this.cli.getCwd(), file)
.then((content) => {
let expectFn = expect(
content,
`Expected file '${file}' to ${
flag ? flag : ''
}${comparator} '${expectedValue}', but found '${content}' which does${
flag ? '' : ' not'
}`
).to
if (flag != undefined) {
expectFn = expectFn.not
}
Then(
/^file (.+) content should (not )?(equal|contain|match) (.+)$/,
function (file, flag, comparator, expectedValue) {
return this.fileSystem
.getFileContent(this.cli.getCwd(), file)
.then((content) => {
let expectFn = expect(
content,
`Expected file '${file}' to ${
flag ? flag : ''
}${comparator} '${expectedValue}', but found '${content}' which does${
flag ? '' : ' not'
}`
).to
if (flag != undefined) {
expectFn = expectFn.not
}

expectFn[comparator](
comparator === 'match' ? new RegExp(expectedValue) : expectedValue
)
})
.catch((err) => {
if (err.code === 'ENOENT') return expect.fail('', '', `File '${file}' should exist`)
expectFn[comparator](
comparator === 'match' ? new RegExp(expectedValue) : expectedValue
)
})
.catch((err) => {
if (err.code === 'ENOENT')
return expect.fail('', '', `File '${file}' should exist`)

return Promise.reject(err)
})
})
return Promise.reject(err)
})
}
)
}

0 comments on commit 49c9d45

Please sign in to comment.