diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..7dbea801 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,74 @@ +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'] + 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 + - 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 + diff --git a/node-tests/addon-test.js b/node-tests/addon-test.js index 19c7ff29..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); }; @@ -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(); })); @@ -1587,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); }; @@ -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(); }));