Skip to content

Commit

Permalink
chore: configure CI to use GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskrycho committed Apr 22, 2021
1 parent 8bee296 commit 753778d
Show file tree
Hide file tree
Showing 5 changed files with 541 additions and 82 deletions.
258 changes: 258 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
# This file was autogenerated by create-github-actions-setup-for-ember-addons.
#
# You can upgrade the GitHub Actions workflow to the latest blueprints used
# by Create GitHub Actions setup for Ember Addons by running it again:
#
# - `yarn create github-actions-setup-for-ember-addons` if using yarn and
# - `npm init github-actions-setup-for-ember-addons` if using NPM.
#
# See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for
# details.
#
# The following lines contain the configuration used in the last run. Please do
# not change them. Doing so could break upgrade flow.
#
#$ browsers:
#$ - chrome
#$ emberTryScenarios:
#$ - scenario: ember-lts-3.16
#$ - scenario: ember-release
#$ - scenario: ember-beta
#$ - scenario: ember-canary
#$ nodeVersion: 10.x
#$ packageManager: yarn
#

name: CI

on:
push:
branches:
- master
pull_request:

env:
NODE_VERSION: "10.x"

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: "${{ env.NODE_VERSION }}"

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
hashFiles('**/yarn.lock'
) }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-
- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-dependencies.outputs.cache-hit != 'true'
- name: Lint
run: yarn lint

test:
name: Tests
runs-on: ${{ matrix.os }}
needs: lint

strategy:
matrix:
os: [ubuntu-latest]
browser: [chrome]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: "${{ env.NODE_VERSION }}"

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
hashFiles('**/yarn.lock'
) }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-
- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-dependencies.outputs.cache-hit != 'true'
- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}

floating-dependencies:
name: Floating Dependencies
runs-on: ${{ matrix.os }}
needs: lint

strategy:
matrix:
os: [ubuntu-latest]
browser: [chrome]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: "${{ env.NODE_VERSION }}"

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-floating-deps
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-
- name: Install Dependencies
run: yarn install --no-lockfile --non-interactive

- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}

required-try-scenarios:
name: Tests - ${{ matrix.ember-try-scenario }}
runs-on: ubuntu-latest
continue-on-error: true
needs: test

strategy:
fail-fast: true
matrix:
ember-try-scenario:
[
ember-lts-3.16,
ember-lts-3.20,
ember-lts-3.24,
ember-release,
ember-beta,
]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: "${{ env.NODE_VERSION }}"

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
hashFiles('**/yarn.lock'
) }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-
- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-dependencies.outputs.cache-hit != 'true'
- name: Test
env:
EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }}
run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO

optional-try-scenarios:
name: Tests - ${{ matrix.ember-try-scenario }}
runs-on: ubuntu-latest
continue-on-error: true
needs: test

strategy:
fail-fast: false
matrix:
ember-try-scenario: [ember-canary]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v2-beta
with:
node-version: "${{ env.NODE_VERSION }}"

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache package manager's global cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
${{ steps.global-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{
hashFiles('**/yarn.lock'
) }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-
- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-dependencies.outputs.cache-hit != 'true'
- name: Test
env:
EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }}
run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

26 changes: 16 additions & 10 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ module.exports = async function() {
},
},
},
{
name: 'ember-lts-3.20',
npm: {
devDependencies: {
'ember-source': '3.20.6',
},
},
},
{
name: 'ember-lts-3.24',
npm: {
devDependencies: {
'ember-source': '3.24.3',
},
},
},
{
name: 'ember-release',
npm: {
Expand All @@ -38,16 +54,6 @@ module.exports = async function() {
},
},
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: 'ember-default',
npm: {
devDependencies: {},
},
},
],
};
};
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
},
"scripts": {
"build": "ember build",
"lint": "npm-run-all lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test",
"test:all": "ember try:each",
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each",
"prepublishOnly": "ember ts:precompile",
"postpublish": "ember ts:clean"
},
Expand Down Expand Up @@ -60,6 +62,7 @@
"eslint-plugin-ember": "^6.2.0",
"eslint-plugin-node": "^9.0.1",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"qunit-dom": "^0.8.4",
"release-it": "^13.1.1",
"release-it-lerna-changelog": "^2.0.0",
Expand Down
Loading

0 comments on commit 753778d

Please sign in to comment.