Skip to content

Commit

Permalink
ci: Added functional backwards compatibility via babel transpilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anadian committed Jan 21, 2021
1 parent 94ba7c9 commit 5a278ce
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 64 deletions.
70 changes: 11 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: ci
- push
- pull_request
jobs:
setup:
transpiled:
strategy:
matrix:
os:
Expand All @@ -21,55 +21,17 @@ jobs:
- 12
- 13
- 14
name: setup-${{ matrix.os }}-node-${{ matrix.node }}
name: transpiled-${{ matrix.os }}-node-${{ matrix.node }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: npm install
build:
strategy:
matrix:
os:
- ubuntu-16.04
- ubuntu-latest
- macos-10.15
- macos-latest
- windows-2016
- windows-latest
node:
- 8
- 9
- 10
- 11
needs: setup
name: build-${{ matrix.os }}-node-${{ matrix.node }}
runs-on: ${{ matrix.os }}
steps:
- run: npm run build
test-build:
strategy:
matrix:
os:
- ubuntu-16.04
- ubuntu-latest
- macos-10.15
- macos-latest
- windows-2016
- windows-latest
node:
- 8
- 9
- 10
- 11
needs: build
name: test-build-${{ matrix.os }}-node-${{ matrix.node }}
runs-on: ${{ matrix.os }}
steps:
- run: ava -v Output/main.test.js
test:
- run: npm transpile
- run: npm transpiled-test
source:
strategy:
matrix:
os:
Expand All @@ -83,10 +45,14 @@ jobs:
- 12
- 13
- 14
needs: setup
name: test-${{ matrix.os }}-node-${{ matrix.node }}
name: source-${{ matrix.os }}-node-${{ matrix.node }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm test
ci-linux:
runs-on: ubuntu-latest
Expand All @@ -99,17 +65,3 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.txt
ci-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm install
- run: npm test
ci-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm install
- run: npm test
77 changes: 73 additions & 4 deletions ci/github-actions.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,76 @@
"pull_request"
],
"jobs": {
"setup":{
"transpiled": {
strategy: {
matrix: {
os: [
"ubuntu-16.04",
"ubuntu-latest",
"macos-10.15",
"macos-latest",
"windows-2016",
"windows-latest"
],
"node": [
8,
9,
10,
11,
12,
13,
14
]
}
},
"name": "transpiled-${{ matrix.os }}-node-${{ matrix.node }}",
"runs-on": "${{ matrix.os }}",
"steps": [
{ "uses": "actions/checkout@v2" },
{
"uses": "actions/setup-node@v2",
"with": {
"node-version": "${{ matrix.node }}"
}
},
{ "run": "npm install" },
{ "run": "npm transpile" },
{ "run": "npm transpiled-test" }
]
},
"source": {
"strategy": {
"matrix": {
"os": [
"ubuntu-16.04",
"ubuntu-latest",
"macos-10.15",
"macos-latest",
"windows-2016",
"windows-latest"
],
"node": [
12,
13,
14
]
}
},
"name": "source-${{ matrix.os }}-node-${{ matrix.node }}",
"runs-on": "${{ matrix.os }}",
"steps": [
{ "uses": "actions/checkout@v2" },
{
"uses": "actions/setup-node@v2",
"with": {
"node-version": "${{ matrix.node }}"
}
},
{ "run": "npm install" },
{ "run": "npm test" }
]
},
/*"setup":{
"strategy": {
"matrix": {
"os": [
Expand Down Expand Up @@ -123,7 +192,7 @@
"steps": [
{ "run": "npm test" }
]
},
},*/
"ci-linux": {
"runs-on": "ubuntu-latest",
"steps": [
Expand All @@ -140,7 +209,7 @@
}
]
},
"ci-macos": {
/*"ci-macos": {
"runs-on": "macos-latest",
"steps": [
{ "uses": "actions/checkout@v2" },
Expand All @@ -157,6 +226,6 @@
{ "run": "npm install" },
{ "run": "npm test" }
]
}
}*/
}
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"description": "Simply extract documentation comments from a source file.",
"main": "source/main.js",
"scripts": {
"build": "babel --out-dir Output source/*",
"transpile": "babel --out-dir Output source/*",
"test": "ava -v ./source/main.test.js",
"transpiled-test": "ava -v ./Output/main.test.js",
"lint": "eslint ./source/main.js",
"generate-docs": "extract-documentation-comments -I source/main.js -O API.md",
"update-config": "hjson -j ci/github-actions.hjson | json2yaml --preserve-key-order -o .github/workflows/ci.yml",
"update-deps": "npm-check-updates -u",
"release": "standard-version",
"publish-release": "git push --follow-tags origin master && npm publish"
},
Expand Down

0 comments on commit 5a278ce

Please sign in to comment.