Skip to content

Commit

Permalink
migrate CI from TravisCI to GitHub actions (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelhan committed Dec 4, 2020
1 parent 3a8ed29 commit daaa0e8
Show file tree
Hide file tree
Showing 4 changed files with 384 additions and 72 deletions.
190 changes: 190 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
name: CI

on:
push:
branches:
- master
pull_request:

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: '10.x'
- 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
id: cache-global-package-manager-cache
uses: actions/cache@v1
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.node-version }}-yarn.lock-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-yarn.lock-
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-nodemodules-
- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-global-package-manager-cache.outputs.cache-hit != 'true' ||
steps.cache-node-modules.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: '10.x'
- 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
id: cache-global-package-manager-cache
uses: actions/cache@v1
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.node-version }}-yarn.lock-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-yarn.lock-
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-nodemodules-
- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-global-package-manager-cache.outputs.cache-hit != 'true' ||
steps.cache-node-modules.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: '10.x'
- 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
id: cache-global-package-manager-cache
uses: actions/cache@v1
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.node-version }}-yarn.lock-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-yarn.lock-
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-nodemodules-
- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-global-package-manager-cache.outputs.cache-hit != 'true' ||
steps.cache-node-modules.outputs.cache-hit != 'true'
- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}

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

strategy:
fail-fast: true
matrix:
ember-try-scenario: [
ember-lts-3.16,
ember-release,
ember-beta,
ember-default-with-jquery,
ember-classic
]
allow-failure: [false]
include:
- ember-try-scenario: ember-canary
allow-failure: true

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-node@v2-beta
with:
node-version: '10.x'
- 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
id: cache-global-package-manager-cache
uses: actions/cache@v1
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.node-version }}-yarn.lock-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-yarn.lock-
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-nodemodules-
- name: Install Dependencies
run: yarn install --frozen-lockfile
if: |
steps.cache-global-package-manager-cache.outputs.cache-hit != 'true' ||
steps.cache-node-modules.outputs.cache-hit != 'true'
- name: Test
env:
EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }}
run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
65 changes: 0 additions & 65 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "ember serve",
"test": "ember test",
"test:all": "ember try:each"
"test:all": "ember try:each",
"test:ember": "ember test"
},
"dependencies": {
"ember-changeset-validations": "^3.0.0",
Expand Down Expand Up @@ -58,6 +60,7 @@
"eslint-plugin-ember": "^7.7.2",
"eslint-plugin-node": "^11.0.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"qunit-dom": "^1.0.0",
"release-it": "^13.3.2",
"release-it-lerna-changelog": "^2.1.2"
Expand Down
Loading

0 comments on commit daaa0e8

Please sign in to comment.