Skip to content

Commit d8e1c39

Browse files
authored
Merge pull request #355 from ember-learn/add-ci-workflow
Migrated from Travis to GitHub Actions
2 parents 195dfbc + 31b9981 commit d8e1c39

File tree

8 files changed

+173
-88
lines changed

8 files changed

+173
-88
lines changed

.github/workflows/ci.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- website-redesign-rfc
8+
tags:
9+
- v[0-9]+.[0-9]+.[0-9]+
10+
pull_request:
11+
12+
env:
13+
NODE_VERSION: 10
14+
PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_number }}
15+
PERCY_PARALLEL_TOTAL: 1
16+
17+
jobs:
18+
lint:
19+
name: Lint files
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 3
22+
steps:
23+
- name: Check out a copy of the repo
24+
uses: actions/checkout@v2
25+
26+
- name: Use Node.js ${{ env.NODE_VERSION }}
27+
uses: actions/setup-node@v2-beta
28+
with:
29+
node-version: ${{ env.NODE_VERSION }}
30+
31+
- name: Cache npm cache and node_modules
32+
id: cache-dependencies
33+
uses: actions/cache@v2
34+
with:
35+
path: |
36+
~/.npm
37+
node_modules
38+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
39+
restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}-
40+
41+
- name: Install dependencies
42+
run: npm install
43+
if: steps.cache-dependencies.outputs.cache-hit != 'true'
44+
45+
- name: Lint
46+
run: npm run lint
47+
48+
49+
test-addon-floating:
50+
name: Test addon (floating dependencies)
51+
runs-on: ubuntu-latest
52+
timeout-minutes: 5
53+
steps:
54+
- name: Check out a copy of the repo
55+
uses: actions/checkout@v2
56+
57+
- name: Use Node.js ${{ env.NODE_VERSION }}
58+
uses: actions/setup-node@v2-beta
59+
with:
60+
node-version: ${{ env.NODE_VERSION }}
61+
62+
- name: Install dependencies
63+
run: npm install --no-package-lock
64+
65+
- name: Test
66+
run: npm run test:ember
67+
68+
69+
test-addon-locked:
70+
name: Test addon (locked dependencies)
71+
runs-on: ubuntu-latest
72+
timeout-minutes: 5
73+
steps:
74+
- name: Check out a copy of the repo
75+
uses: actions/checkout@v2
76+
77+
- name: Use Node.js ${{ env.NODE_VERSION }}
78+
uses: actions/setup-node@v2-beta
79+
with:
80+
node-version: ${{ env.NODE_VERSION }}
81+
82+
- name: Cache npm cache and node_modules
83+
id: cache-dependencies
84+
uses: actions/cache@v2
85+
with:
86+
path: |
87+
~/.npm
88+
node_modules
89+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
90+
restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}-
91+
92+
- name: Install dependencies
93+
run: npm install
94+
if: steps.cache-dependencies.outputs.cache-hit != 'true'
95+
96+
- name: Test
97+
uses: percy/[email protected]
98+
with:
99+
custom-command: npm run test:ember
100+
env:
101+
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
102+
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
103+
PERCY_TOKEN: ee0a9d5c1122d6a21852edf19b5b309aaec18077fb3900c98995c90bc48ed240
104+
105+
106+
test-compatibility:
107+
name: Test compatibility
108+
runs-on: ubuntu-latest
109+
strategy:
110+
fail-fast: true
111+
matrix:
112+
scenario:
113+
- 'ember-lts-3.8'
114+
- 'ember-lts-3.12'
115+
- 'ember-lts-3.16'
116+
- 'ember-lts-3.20'
117+
- 'ember-release'
118+
- 'ember-beta'
119+
- 'ember-canary'
120+
- 'ember-default-with-jquery'
121+
- 'ember-classic'
122+
timeout-minutes: 7
123+
steps:
124+
- name: Check out a copy of the repo
125+
uses: actions/checkout@v2
126+
127+
- name: Use Node.js ${{ env.NODE_VERSION }}
128+
uses: actions/setup-node@v2-beta
129+
with:
130+
node-version: ${{ env.NODE_VERSION }}
131+
132+
- name: Cache npm cache and node_modules
133+
id: cache-dependencies
134+
uses: actions/cache@v2
135+
with:
136+
path: |
137+
~/.npm
138+
node_modules
139+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ matrix.scenario }}-${{ hashFiles('**/package-lock.json') }}
140+
restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ matrix.scenario }}-
141+
142+
- name: Install dependencies
143+
run: npm install
144+
if: steps.cache-dependencies.outputs.cache-hit != 'true'
145+
146+
- name: Test
147+
run: npm run test:ember-compatibility ${{ matrix.scenario }}

.travis.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
## Linting
1010

11-
* `npm run lint:hbs`
12-
* `npm run lint:js`
11+
* `npm run lint`
1312
* `npm run lint:js -- --fix`
1413

1514
## Running tests
1615

16+
* `npm run test`
1717
* `ember test` – Runs the test suite on the current Ember version
1818
* `ember test --server` – Runs the test suite in "watch mode"
1919
* `ember try:each` – Runs the test suite against multiple Ember versions

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
ember-styleguide [![Build Status](https://travis-ci.org/ember-learn/ember-styleguide.svg?branch=master)](https://travis-ci.org/ember-learn/ember-styleguide) [![Latest NPM release](https://img.shields.io/npm/v/ember-styleguide.svg)](https://www.npmjs.com/package/ember-styleguide.svg)
1+
[![This project uses GitHub Actions for continuous integration.](https://github.com/ember-learn/ember-styleguide/workflows/CI/badge.svg)](https://github.com/ember-learn/ember-styleguide/actions?query=workflow%3ACI)
2+
[![This project uses Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/Ember/ember-styleguide)
3+
[![Latest NPM release](https://img.shields.io/npm/v/ember-styleguide.svg)](https://www.npmjs.com/package/ember-styleguide.svg)
4+
5+
ember-styleguide
26
==============================================================================
37

48
This addon is intended to provide basic components for easier style coordination among the Ember family of websites, although the original intent is to support the emberjs.com website. We are committed to the goal of meeting WCAG 2.0 AA conformance standards.
@@ -21,7 +25,7 @@ Installation
2125

2226
* `git clone <repository-url>` this repository
2327
* `cd ember-styleguide`
24-
* `yarn install`
28+
* `npm install`
2529

2630
## Running
2731

config/ember-try.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ module.exports = async function() {
2929
}
3030
}
3131
},
32+
{
33+
name: 'ember-lts-3.20',
34+
npm: {
35+
devDependencies: {
36+
'ember-source': '~3.20.5'
37+
}
38+
}
39+
},
3240
{
3341
name: 'ember-release',
3442
npm: {
@@ -53,16 +61,6 @@ module.exports = async function() {
5361
}
5462
}
5563
},
56-
// The default `.travis.yml` runs this scenario via `npm test`,
57-
// not via `ember try`. It's still included here so that running
58-
// `ember try:each` manually or from a customized CI config will run it
59-
// along with all the other scenarios.
60-
{
61-
name: 'ember-default',
62-
npm: {
63-
devDependencies: {}
64-
}
65-
},
6664
{
6765
name: 'ember-default-with-jquery',
6866
env: {
@@ -72,7 +70,7 @@ module.exports = async function() {
7270
},
7371
npm: {
7472
devDependencies: {
75-
'@ember/jquery': '^0.5.1'
73+
'@ember/jquery': '^1.1.0'
7674
}
7775
}
7876
},

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"lint:js": "eslint .",
2525
"release": "np",
2626
"start": "ember serve",
27-
"test": "npm-run-all lint:* test:*",
27+
"test": "npm-run-all test:*",
2828
"test:ember": "ember test",
29-
"ember-compatibility-test": "ember try:each"
29+
"test:ember-compatibility": "ember try:one"
3030
},
3131
"dependencies": {
3232
"@ember/render-modifiers": "^1.0.2",

testem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
module.exports = {
4-
test_page: 'tests/index.html?hidepassed',
4+
test_page: 'tests/index.html?hidepassed&nolint',
55
disable_watching: true,
66
launch_in_ci: [
77
'Chrome'

tests/dummy/config/targets.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ const browsers = [
66
'last 1 Safari versions'
77
];
88

9-
// TODO: Temporary fix for Travis tests
10-
// const isCI = !!process.env.CI;
11-
// const isProduction = process.env.EMBER_ENV === 'production';
12-
//
13-
// if (isCI || isProduction) {
14-
// browsers.push('ie 11');
15-
// }
9+
const isCI = Boolean(process.env.CI);
10+
const isProduction = process.env.EMBER_ENV === 'production';
11+
12+
if (isCI || isProduction) {
13+
browsers.push('ie 11');
14+
}
1615

1716
module.exports = {
1817
browsers

0 commit comments

Comments
 (0)