diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..0038b7760 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,94 @@ +name: CI + +on: + pull_request: + push: + # Filtering branches here prevents duplicate builds from pull_request and push + branches: + - master + - beta + - 'v*' + - /^greenkeeper.*$/ + + # Always run CI for tags + tags: + - '*' + + # Early issue detection: run CI weekly on Sundays + schedule: + - cron: '0 6 * * 0' + +env: + CI: true + +jobs: + test-mocha: + name: Mocha Tests - ${{ matrix.node-version }} + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 10.x] + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install NPM version 4 + run: | + npm config set spin false + npm install -g npm@4 + - name: Yarn Install + run: yarn install --ignore-engines + - name: Run Mocha Tests + run: yarn test:mocha + + test-mocha-windows: + name: Mocha Windows Tests - ${{ matrix.node-version }} + runs-on: windows-latest + + strategy: + matrix: + node-version: [12.x, 10.x] + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install NPM version 4 + run: | + npm config set spin false + npm install -g npm@4 + - name: Install Phantomjs + run: choco install phantomjs + - name: Yarn Install + run: yarn install --ignore-engines + - name: Run Mocha Tests + run: yarn test:mocha + + test-ember: + name: Ember Tests ${{ matrix.os }} - ${{ matrix.node-version }} + runs-on: ${{ matrix.os }} + + strategy: + matrix: + node-version: [12.x, 10.x] + os: [ubuntu-latest, windows-latest] + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Yarn Install + run: yarn install --ignore-engines + - name: Run Tests + run: yarn test:ember diff --git a/package.json b/package.json index 474598fe6..f30dcbf97 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,8 @@ "release": "release-it", "start": "ember serve", "test": "mocha && ember test", + "test:mocha": "mocha", + "test:ember": "ember test", "test:precook": "node node_modules/ember-cli-addon-tests/scripts/precook-node-modules.js" }, "dependencies": {