Skip to content

Commit 6409cb8

Browse files
Merge pull request #4 from cucumber/add-some-ci
Add CI
2 parents 71b787e + 211d609 commit 6409cb8

File tree

9 files changed

+168
-17
lines changed

9 files changed

+168
-17
lines changed

.github/workflows/go.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: test-go
5+
6+
on:
7+
push:
8+
pull_request:
9+
types:
10+
- merged
11+
branches:
12+
- master
13+
14+
jobs:
15+
test:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os:
21+
- ubuntu-latest
22+
go: [1.13.x, 1.17.x]
23+
include:
24+
- os: windows-latest
25+
go: '1.17.x'
26+
- os: macos-latest
27+
go: '1.17.x'
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Set up Go
32+
uses: actions/setup-go@v2
33+
with:
34+
go-version: ${{ matrix.go }}
35+
- name: lint
36+
working-directory: ./go
37+
run: gofmt -w .
38+
- name: test
39+
working-directory: ./go
40+
run: go test ./...

.github/workflows/javascript.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: test-javascript
5+
6+
on:
7+
push:
8+
pull_request:
9+
types:
10+
- merged
11+
branches:
12+
- master
13+
14+
jobs:
15+
test:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os:
21+
- ubuntu-latest
22+
node-version: [12.x, 14.x, 16.x]
23+
include:
24+
- os: windows-latest
25+
node-version: 16.x
26+
- os: macos-latest
27+
node-version: 16.x
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
32+
uses: actions/setup-node@v2
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
- run: npm i -g npm@7
36+
- name: npm install-test
37+
working-directory: ./javascript
38+
run: npm install-test
39+

.github/workflows/ruby.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: test-ruby
5+
6+
on:
7+
push:
8+
pull_request:
9+
types:
10+
- merged
11+
branches:
12+
- master
13+
14+
jobs:
15+
test:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os:
21+
- ubuntu-latest
22+
ruby: [2.5, 2.6, 2.7, '3.0']
23+
include:
24+
- os: windows-latest
25+
ruby: '3.0'
26+
- os: macos-latest
27+
ruby: '3.0'
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Set up Ruby
32+
uses: ruby/setup-ruby@v1
33+
with:
34+
ruby-version: ${{ matrix.ruby }}
35+
bundler-cache: true
36+
working-directory: ./ruby
37+
- name: bundle exec rspec
38+
working-directory: ./ruby
39+
run: bundle exec rspec

go/expression_examples_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ func TestExamples(t *testing.T) {
1616
require.NoError(t, err)
1717

1818
chunks := strings.Split(string(examples), "---")
19+
newLine := regexp.MustCompile("\r?\n")
1920
for _, chunk := range chunks {
20-
lines := strings.Split(strings.TrimSpace(chunk), "\n")
21+
lines := newLine.Split(strings.TrimSpace(chunk), -1)
2122
expressionText, text, expectedArgs := lines[0], lines[1], lines[2]
2223
t.Run(fmt.Sprintf("works with %s", expressionText), func(t *testing.T) {
2324
args := MatchExample(t, expressionText, text)

javascript/test/ExpressionExamplesTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('examples.txt', () => {
2020
const examples = fs.readFileSync('examples.txt', 'utf-8')
2121
const chunks = examples.split(/^---/m)
2222
for (const chunk of chunks) {
23-
const [expressionText, text, expectedArgs] = chunk.trim().split(/\n/m)
23+
const [expressionText, text, expectedArgs] = chunk.trim().split(/\r?\n/m)
2424
it(`Works with: ${expressionText}`, () => {
2525
assert.deepStrictEqual(JSON.stringify(match(expressionText, text)), expectedArgs)
2626
})

javascript/tsconfig.build-cjs.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{
2-
"extends": "../../tsconfig.build-cjs.json",
2+
"extends": "./tsconfig.build.json",
33
"compilerOptions": {
4-
"rootDir": ".",
5-
"outDir": "dist/cjs"
4+
"outDir": "dist/cjs",
5+
"target": "ES5",
6+
"module": "CommonJS",
67
},
7-
"include": [
8-
"src",
9-
"test"
10-
],
118
}

javascript/tsconfig.build-esm.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"extends": "../../tsconfig.build-esm.json",
2+
"extends": "./tsconfig.build.json",
33
"compilerOptions": {
4-
"rootDir": ".",
4+
"lib": [
5+
"ES2019"
6+
],
7+
"target": "ES6",
8+
"module": "ES6",
59
"outDir": "dist/esm"
610
},
7-
"include": [
8-
"src",
9-
"test"
10-
],
1111
}

javascript/tsconfig.build.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"composite": true,
5+
"declaration": true,
6+
"declarationMap": true,
7+
"sourceMap": true,
8+
"rootDir": ".",
9+
"noEmit": false
10+
},
11+
"include": [
12+
"src",
13+
"test"
14+
],
15+
}

javascript/tsconfig.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
{
2-
"extends": "../../tsconfig.esm.json"
3-
}
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"declaration": true,
5+
"sourceMap": true,
6+
"allowJs": false,
7+
"resolveJsonModule": true,
8+
"esModuleInterop": true,
9+
"noImplicitAny": true,
10+
"downlevelIteration": true,
11+
"skipLibCheck": true,
12+
"strictNullChecks": false,
13+
"experimentalDecorators": true,
14+
"module": "esnext",
15+
"lib": [
16+
"es6"
17+
],
18+
"target": "ESNext",
19+
"moduleResolution": "node",
20+
"allowSyntheticDefaultImports": true,
21+
"noEmit": true
22+
}
23+
}

0 commit comments

Comments
 (0)