From 9d0a559e6b81cad2a2cd40d9a2742b3983923490 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 28 May 2020 22:15:35 -0400 Subject: [PATCH 1/4] Add GitHub Actions CI. --- .github/workflows/ci.yml | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..1853594d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +name: CI + +on: + push: + branches: + - master + - 'v*' # older version branches + tags: + - '*' + + pull_request: {} + schedule: + - cron: '0 6 * * 0' # weekly, on sundays + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '12.x' + - name: install dependencies + run: yarn install --frozen-lockfile --ignore-engines + - name: lint + run: yarn lint:js + + test: + name: "Node ${{ matrix.node }} - ${{ matrix.os }}" + runs-on: "${{matrix.os}}-latest" + + strategy: + matrix: + os: ['ubuntu', 'windows', 'macOS'] + node: ['6', '8', '10', '12', '14'] + + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - name: install dependencies + run: yarn install --frozen-lockfile --ignore-engines + - name: test + run: yarn test + + floating-test: + name: Floating dependencies + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '12.x' + - name: install dependencies + run: yarn install --no-lockfile --ignore-engines + - name: test + run: yarn test + From 3b712e952df3977a38acf46c90d0edf61d2e06b8 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 29 May 2020 11:38:05 -0400 Subject: [PATCH 2/4] Avoid knock on errors in `afterEach` --- node-tests/addon-test.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/node-tests/addon-test.js b/node-tests/addon-test.js index 19c7ff29..e5ec7662 100644 --- a/node-tests/addon-test.js +++ b/node-tests/addon-test.js @@ -1401,8 +1401,15 @@ describe('EmberData Packages Polyfill', function() { afterEach(co.wrap(function*() { unlink(); - yield input.dispose(); - yield output.dispose(); + + if (input) { + yield input.dispose(); + } + + if (output) { + yield output.dispose(); + } + // shut down workers after the tests are run so that mocha doesn't hang yield terminateWorkerPool(); })); @@ -1607,8 +1614,15 @@ describe('EmberData Packages Polyfill - ember-cli-babel for ember-data', functio afterEach(co.wrap(function*() { unlink(); - yield input.dispose(); - yield output.dispose(); + + if (input) { + yield input.dispose(); + } + + if (output) { + yield output.dispose(); + } + // shut down workers after the tests are run so that mocha doesn't hang yield terminateWorkerPool(); })); From 40e10d7fa6560ca85a8f895ab792e1cea93417d8 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 29 May 2020 12:19:17 -0400 Subject: [PATCH 3/4] Use Junctions for symlinking on Windows. --- node-tests/addon-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node-tests/addon-test.js b/node-tests/addon-test.js index e5ec7662..8b8f4ec6 100644 --- a/node-tests/addon-test.js +++ b/node-tests/addon-test.js @@ -1383,7 +1383,7 @@ describe('EmberData Packages Polyfill', function() { let linkPath = path.join(fixturifyProject.root, '/whatever/node_modules/ember-cli-babel'); let addonPath = path.resolve(__dirname, '../'); rimraf.sync(linkPath); - fs.symlinkSync(addonPath, linkPath); + fs.symlinkSync(addonPath, linkPath, 'junction'); unlink = () => { fs.unlinkSync(linkPath); }; @@ -1594,7 +1594,7 @@ describe('EmberData Packages Polyfill - ember-cli-babel for ember-data', functio let linkPath = path.join(fixturifyProject.root, `/whatever/node_modules/${p}/node_modules/ember-cli-babel`); let addonPath = path.resolve(__dirname, '../'); rimraf.sync(linkPath); - fs.symlinkSync(addonPath, linkPath); + fs.symlinkSync(addonPath, linkPath, 'junction'); unlink = () => { fs.unlinkSync(linkPath); }; From 472899a4e595eb5cd88697473bee6fc28d440ba3 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Fri, 29 May 2020 12:47:08 -0400 Subject: [PATCH 4/4] Exclude Node 14 + macOS CI run. --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1853594d..7dbea801 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,18 @@ jobs: matrix: os: ['ubuntu', 'windows', 'macOS'] node: ['6', '8', '10', '12', '14'] + exclude: + # excludes node 14 on macOS, this is because + # ember-cli (until ~ 3.12) calls + # `fs.writeFileSync('./tmp/.metadata_never_index)` on macOS platforms + # to instruct spotlight to avoid indexing the local tmp folder + # unfortunately, ember-cli does not pass a value for second arg (the + # content to write) and Node 14 added an assertion + # + # TODO: delete this when we have dropped Node 6 and can update + # ember-cli to a version that doesn't do this + - os: 'macOS' + node: '14' steps: - uses: actions/checkout@v1