Skip to content

Commit

Permalink
Merge pull request emberjs#339 from babel/add-github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed May 29, 2020
2 parents 4db83fc + 472899a commit d835fbb
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 6 deletions.
74 changes: 74 additions & 0 deletions .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

26 changes: 20 additions & 6 deletions node-tests/addon-test.js
Expand Up @@ -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);
};
Expand All @@ -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();
}));
Expand Down Expand Up @@ -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);
};
Expand All @@ -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();
}));
Expand Down

0 comments on commit d835fbb

Please sign in to comment.