From 2c8c645bdc0f55772b643cdaaea38ccd7b28b3d5 Mon Sep 17 00:00:00 2001 From: MrChocolatine <47531779+MrChocolatine@users.noreply.github.com> Date: Thu, 14 Oct 2021 16:18:20 +0100 Subject: [PATCH] ci: reset GH workflow to Ember's implementation Inspired from: https://github.com/peopledoc/ember-cli-embedded/pull/144 Ember's implementation: https://github.com/ember-cli/ember-addon-output/blob/v4.0.0-beta.1/.github/workflows/ci.yml ci: add tests for Embroider compatibility --- .github/workflows/ci.yml | 244 +++++++++++---------------------------- README.md | 4 +- config/ember-try.js | 11 +- ember-cli-build.js | 3 +- package.json | 1 + yarn.lock | 10 +- 6 files changed, 84 insertions(+), 189 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a2ff91..66e3404 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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' @@ -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 }} diff --git a/README.md b/README.md index 9c87a85..9ca832f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/config/ember-try.js b/config/ember-try.js index ac07b8f..2c94ecb 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -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: { @@ -66,6 +59,8 @@ module.exports = async function () { }, }, }, + embroiderSafe(), + embroiderOptimized(), ], } } diff --git a/ember-cli-build.js b/ember-cli-build.js index 48dcd62..966caad 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -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, { @@ -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) } diff --git a/package.json b/package.json index 100ced6..c38d666 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/yarn.lock b/yarn.lock index 1086283..8ea1f68 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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==