Skip to content

Commit

Permalink
ci: reset GH workflow to Ember's implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
MrChocolatine committed Oct 14, 2021
1 parent a1571fd commit 93d90d1
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 189 deletions.
244 changes: 67 additions & 177 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
# 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.12
#$ - scenario: ember-lts-3.16
#$ - scenario: ember-lts-3.20
#$ - scenario: ember-release
#$ - scenario: ember-default-with-jquery
#$ - scenario: ember-classic
#$ nodeVersion: '12'
#$ packageManager: yarn
#

name: CI

on:
push:
branches:
- main
- master
pull_request:
pull_request: {}

env:
NODE_VERSION: '12'
Expand All @@ -40,177 +14,93 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 20

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

- uses: actions/setup-node@v2
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
- uses: actions/checkout@v2

- name: Install Node
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Lint
run: yarn run lint

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

strategy:
matrix:
os: [ubuntu-latest]
browser: [Chrome]
runs-on: ubuntu-latest
timeout-minutes: 20

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

- uses: actions/setup-node@v2
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
- uses: actions/checkout@v2

strategy:
matrix:
os: [ubuntu-latest]
browser: [Chrome]
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install Dependencies
run: yarn install --frozen-lockfile

- uses: actions/setup-node@v2
with:
node-version: '${{ env.NODE_VERSION }}'
- name: Run Tests
run: yarn run test:ember

- name: Get package manager's global cache path
id: global-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
floating:
name: Floating Dependencies
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 20

- 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 }}-
steps:
- uses: actions/checkout@v2

- name: Install Dependencies
run: yarn install --no-lockfile --non-interactive
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}
- name: Install Dependencies
run: yarn install --no-lockfile --non-interactive

- name: Run Tests
run: yarn run test:ember

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

strategy:
fail-fast: true
matrix:
ember-try-scenario: [
ember-lts-3.12,
ember-lts-3.16,
ember-lts-3.20,
ember-release,
ember-default-with-jquery,
ember-classic
]
try-scenario:
- ember-lts-3.16
- ember-lts-3.20
- ember-release
- ember-classic
- ember-default-with-jquery
- embroider-safe
- embroider-optimized

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

- uses: actions/setup-node@v2
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
- uses: actions/checkout@v2

- name: Install Node
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Ember-metrics-pendo allows to configure the [Pendo](https://www.pendo.io) servic

## Compatibility

* Ember.js v3.12 or above
* Ember CLI v2.13 or above
* Ember.js v3.16 or above
* Ember CLI v3.16 or above
* Node.js v12 or above


Expand Down
11 changes: 3 additions & 8 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
'use strict'

const getChannelURL = require('ember-source-channel-url')
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup')

module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-3.12',
npm: {
devDependencies: {
'ember-source': '~3.12.0',
},
},
},
{
name: 'ember-lts-3.16',
npm: {
Expand Down Expand Up @@ -66,6 +59,8 @@ module.exports = async function () {
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
}
}
3 changes: 2 additions & 1 deletion ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'

const EmberAddon = require('ember-cli/lib/broccoli/ember-addon')
const { maybeEmbroider } = require('@embroider/test-setup')

module.exports = function (defaults) {
let app = new EmberAddon(defaults, {
Expand All @@ -14,5 +15,5 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree()
return maybeEmbroider(app)
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.1.4",
"@embroider/test-setup": "^0.47.0",
"@glimmer/component": "^1.0.3",
"@glimmer/tracking": "^1.0.3",
"babel-eslint": "^10.1.0",
Expand Down
10 changes: 9 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,14 @@
resolve "^1.8.1"
semver "^7.3.2"

"@embroider/test-setup@^0.47.0":
version "0.47.0"
resolved "https://registry.yarnpkg.com/@embroider/test-setup/-/test-setup-0.47.0.tgz#ea307583efaac227b71c5ad348fecac362637e0c"
integrity sha512-KadqpSno0qyhVW2VtXTU7i9OQHNT1tpcrQ+06sTaFmX275yGxHUTcSr//CV1ErtzejcVPvkGnRQIUKPRXZsNVA==
dependencies:
lodash "^4.17.21"
resolve "^1.20.0"

"@eslint/eslintrc@^0.4.3":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c"
Expand Down Expand Up @@ -7566,7 +7574,7 @@ lodash.uniqby@^4.7.0:
resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302"
integrity sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI=

lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4, lodash@^4.6.1, lodash@^4.7.0:
lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.6.1, lodash@^4.7.0:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down

0 comments on commit 93d90d1

Please sign in to comment.