Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.6.0 #5374

Merged
merged 10 commits into from
Sep 19, 2021
Merged

2.6.0 #5374

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 17 additions & 21 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,34 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, macos-latest, windows-latest]
node-version: [6.x, 8.x, 10.x, 12.x, 14.x, 16.x]
node-version: [10.x, 12.x, 14.x, 16.x]

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

# Puppeteer runs an install script that requires Node 10+.
# Also, the `npm ci` command doesn’t exist on the version of npm that shipped with Node 6.
- run: node --eval "pjson = JSON.parse(require('fs').readFileSync('./package.json')); delete pjson.devDependencies.puppeteer; require('fs').writeFileSync('./package.json', JSON.stringify(pjson), 'utf8')"
if: matrix.node-version == '6.x' || matrix.node-version == '8.x'
- run: npm install
if: matrix.node-version == '6.x'
- run: npm ci
if: matrix.node-version != '6.x'

- run: node ./bin/cake test
- run: node --harmony ./bin/cake test

- run: node ./bin/cake test:browser
if: matrix.node-version != '6.x' && matrix.node-version != '8.x'

- run: node ./bin/cake test:browser:node

- run: node ./bin/cake test:integrations

# Ensure that we can still build in the current version of Node
- run: node ./bin/cake build:except-parser
- run: node ./bin/cake build:parser
- run: node ./bin/cake build:full
# Build twice to ensure that the latest build of the compiler can still build itself
- run: node ./bin/cake build:except-parser
- run: node ./bin/cake build:parser
# Build the browser compiler for the headless browser test
- run: node ./bin/cake build:browser

# Check that the git diff is clean, to ensure that the updated build output was committed
- run: git diff --exit-code
if: matrix.node-version != '6.x' && matrix.node-version != '8.x'

# Build test.html, so that test:browser uses the latest tests
- run: node ./bin/cake doc:test

# Test
- run: node ./bin/cake test
- run: node ./bin/cake test:browser
- run: node ./bin/cake test:browser:node
- run: node ./bin/cake test:integrations
17 changes: 10 additions & 7 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ buildDocs = (watch = no) ->
markdownRenderer = require('markdown-it')
html: yes
typographer: yes
highlight: (str, lang) ->
highlight: (str, language) ->
# From https://github.com/markdown-it/markdown-it#syntax-highlighting
if lang and hljs.getLanguage(lang)
if language and hljs.getLanguage(language)
try
return hljs.highlight(lang, str).value
return hljs.highlight(str, { language }).value
catch ex
return '' # No syntax highlighting

Expand Down Expand Up @@ -502,7 +502,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
# version of the browser compiler. There’s no reason to run this test in old
# versions of Node (the runtime is the headless Chrome browser, not Node),
# and Puppeteer 3 only supports Node >= 10.18.1, so limit this test to those
# versions. The code below uses `Promise.prototype.finally` because the
# versions. The code below uses `Promise.prototype.finally` because the
# CoffeeScript codebase currently maintains compatibility with Node 6, which
# did not support `async`/`await` syntax. Even though this test doesn’t run
# in Node 6, it needs to still _parse_ in Node 6 so that this file can load.
Expand Down Expand Up @@ -537,7 +537,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
page = pageHandle
page.goto 'http://localhost:8080/'
).then(->
page.waitFor '#result',
page.waitForSelector '#result',
visible: yes
polling: 'mutation'
).then((element) ->
Expand All @@ -548,7 +548,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
browser.close()
).finally ->
server.close()
if result and 'failed' not in result
if result and not result.includes('failed')
log result, green
else
log result, red
Expand All @@ -570,6 +570,9 @@ task 'test:integrations', 'test the module integrated with other libraries and e
# can be built by such tools; if such a build succeeds, it verifies that no
# Node modules are required as part of the compiler (as opposed to the tests)
# and that therefore the compiler will run in a browser environment.
# Webpack 5 requires Node >= 10.13.0.
[major, minor] = process.versions.node.split('.').map (n) -> parseInt(n, 10)
return if major < 10 or (major is 10 and minor < 13)
tmpdir = os.tmpdir()
webpack = require 'webpack'
webpack {
Expand All @@ -594,7 +597,7 @@ task 'test:integrations', 'test the module integrated with other libraries and e
process.exit 1

builtCompiler = path.join tmpdir, 'coffeescript.js'
CoffeeScript = require builtCompiler
{ CoffeeScript } = require builtCompiler
global.testingBrowser = yes
testResults = runTests CoffeeScript
fs.unlinkSync builtCompiler
Expand Down
Loading