├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .prettierrc.js ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── RELEASE.md ├── bin └── create-github-actions-setup-for-ember-addon ├── jest.config.js ├── package.json ├── src ├── index.ts ├── parser │ ├── defaults.ts │ ├── previous-run.ts │ └── travis-ci.ts └── utils │ ├── debug.ts │ ├── determine-configuration.ts │ └── index.ts ├── templates └── .github │ └── workflows │ └── ci.yml ├── tests ├── acceptance │ ├── __snapshots__ │ │ └── creates-github-actions.test.ts.snap │ └── creates-github-actions.test.ts ├── fixtures │ ├── defaults │ │ ├── ember-try-as-created-by-ember-cli-3.24 │ │ │ ├── config │ │ │ │ └── ember-try.js │ │ │ ├── package.json │ │ │ ├── testem.js │ │ │ └── yarn.lock │ │ ├── engines-node-using-or │ │ │ ├── config │ │ │ │ └── ember-try.js │ │ │ ├── package.json │ │ │ ├── testem.js │ │ │ └── yarn.lock │ │ ├── npm │ │ │ ├── config │ │ │ │ └── ember-try.js │ │ │ ├── package-lock.json │ │ │ ├── package.json │ │ │ └── testem.js │ │ ├── testem-config-generated-by-ember-cli-3.20 │ │ │ ├── config │ │ │ │ └── ember-try.js │ │ │ ├── package.json │ │ │ ├── testem.js │ │ │ └── yarn.lock │ │ ├── testem-config-including-firefox │ │ │ ├── config │ │ │ │ └── ember-try.js │ │ │ ├── package.json │ │ │ ├── testem.js │ │ │ └── yarn.lock │ │ └── yarn │ │ │ ├── config │ │ │ └── ember-try.js │ │ │ ├── package.json │ │ │ ├── testem.js │ │ │ └── yarn.lock │ ├── github-actions │ │ └── previous-run │ │ │ └── .github │ │ │ └── workflows │ │ │ └── ci.yml │ └── travis-ci │ │ ├── ember-3.12-npm │ │ └── .travis.yml │ │ ├── ember-3.16-npm │ │ └── .travis.yml │ │ ├── ember-3.20-npm │ │ └── .travis.yml │ │ ├── ember-3.20-yarn │ │ └── .travis.yml │ │ ├── ember-3.4-npm │ │ └── .travis.yml │ │ └── ember-3.8-npm │ │ └── .travis.yml └── utils │ └── fixtures.ts ├── tsconfig.json ├── types └── js-yaml │ └── index.d.ts └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.hbs] 17 | insert_final_newline = false 18 | 19 | [*.{diff,md}] 20 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | node_modules/ 3 | tests/fixtures/ 4 | types/ 5 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | root: true, 5 | parser: '@typescript-eslint/parser', 6 | parserOptions: { 7 | ecmaVersion: 2020, 8 | sourceType: 'module', 9 | }, 10 | env: { 11 | node: true, 12 | }, 13 | plugins: ['jest'], 14 | extends: [ 15 | 'eslint:recommended', 16 | 'plugin:@typescript-eslint/recommended', 17 | 'prettier/@typescript-eslint', 18 | 'plugin:prettier/recommended', 19 | ], 20 | overrides: [ 21 | // tests 22 | { 23 | files: ['tests/**/*.test.js'], 24 | extends: ['plugin:jest/recommended'], 25 | env: { 26 | 'jest/globals': true, 27 | }, 28 | }, 29 | ], 30 | }; 31 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | 9 | jobs: 10 | lint: 11 | name: Lint 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | with: 16 | fetch-depth: 1 17 | - uses: actions/setup-node@v2-beta 18 | with: 19 | node-version: '12.x' 20 | - name: Install Dependencies 21 | run: yarn install --frozen-lockfile 22 | - name: Lint 23 | run: yarn lint 24 | 25 | test: 26 | name: Tests 27 | runs-on: ubuntu-latest 28 | needs: lint 29 | steps: 30 | - uses: actions/checkout@v2 31 | with: 32 | fetch-depth: 1 33 | - uses: actions/setup-node@v2-beta 34 | with: 35 | node-version: '12.x' 36 | - name: Install Dependencies 37 | run: yarn install --frozen-lockfile 38 | - name: Test 39 | run: yarn test 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | yarn-debug.log* 3 | yarn-error.log* 4 | 5 | # Dependency directories 6 | node_modules 7 | 8 | # Build output 9 | dist 10 | 11 | # Optional eslint cache 12 | .eslintcache 13 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | singleQuote: true, 5 | }; 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## v0.7.0 (2021-04-10) 4 | 5 | #### :boom: Breaking Change 6 | * [#45](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/45) All Ember Try Scenarios should run if one fails ([@jelhan](https://github.com/jelhan)) 7 | 8 | #### Committers: 1 9 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 10 | 11 | ## v0.6.0 (2021-02-15) 12 | 13 | #### :rocket: Enhancement 14 | * [#42](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/42) Add support for node 12.x ([@jelhan](https://github.com/jelhan)) 15 | 16 | #### Committers: 1 17 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 18 | 19 | ## v0.5.1 (2021-01-07) 20 | 21 | #### :bug: Bug Fix 22 | * [#36](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/36) generated floating deps test must ignore lockfile ([@jelhan](https://github.com/jelhan)) 23 | 24 | #### Committers: 1 25 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 26 | 27 | ## v0.5.0 (2021-01-07) 28 | 29 | #### :rocket: Enhancement 30 | * [#34](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/34) Use reasonable defaults based on the project ([@jelhan](https://github.com/jelhan)) 31 | 32 | #### :house: Internal 33 | * [#33](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/33) Reorganize file structure for fixtures ([@jelhan](https://github.com/jelhan)) 34 | 35 | #### Committers: 1 36 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 37 | 38 | ## v0.4.0 (2020-12-21) 39 | 40 | #### :rocket: Enhancement 41 | * [#31](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/31) Log configuration used ([@jelhan](https://github.com/jelhan)) 42 | * [#29](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/29) Support upgrades of generated workflows ([@jelhan](https://github.com/jelhan)) 43 | * [#27](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/27) Make configuration interface more flexible for upcoming use cases ([@jelhan](https://github.com/jelhan)) 44 | * [#25](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/25) Simplify cache setup ([@jelhan](https://github.com/jelhan)) 45 | 46 | #### :memo: Documentation 47 | * [#24](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/24) Add contributing docs ([@jelhan](https://github.com/jelhan)) 48 | 49 | #### Committers: 1 50 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 51 | 52 | 53 | ## v0.3.0 (2020-12-06) 54 | 55 | #### :rocket: Enhancement 56 | * [#23](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/23) Improved readability of created workflow ([@ijlee2](https://github.com/ijlee2)) 57 | * [#20](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/20) Simplify node version upgrades by defining it once in created workflow ([@jelhan](https://github.com/jelhan)) 58 | 59 | #### Committers: 2 60 | - Isaac Lee ([@ijlee2](https://github.com/ijlee2)) 61 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 62 | 63 | ## v0.2.1 (2020-12-02) 64 | 65 | #### :bug: Bug Fix 66 | * [#18](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/18) cache key should not mention yarn if NPM is used ([@jelhan](https://github.com/jelhan)) 67 | 68 | #### Committers: 1 69 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 70 | 71 | ## v0.2.0 (2020-11-28) 72 | 73 | #### :rocket: Enhancement 74 | * [#11](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/11) cache dependencies in created workflow ([@jelhan](https://github.com/jelhan)) 75 | 76 | #### Committers: 1 77 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 78 | 79 | ## v0.1.3 (2020-11-23) 80 | 81 | #### :bug: Bug Fix 82 | * [#10](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/10) fix typo in expected travis CI config file name ([@jelhan](https://github.com/jelhan)) 83 | 84 | #### Committers: 1 85 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 86 | 87 | ## v0.1.2 (2020-11-23) 88 | 89 | #### :bug: Bug Fix 90 | * [#7](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/7) CI should run only once per commit ([@jelhan](https://github.com/jelhan)) 91 | 92 | #### :house: Internal 93 | * [#8](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/8) run own CI only once per pull request ([@jelhan](https://github.com/jelhan)) 94 | 95 | #### Committers: 1 96 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 97 | 98 | ## v0.1.1 (2020-11-22) 99 | 100 | #### :bug: Bug Fix 101 | * [#3](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/3) Remove patch-package postinstall step which breaks if dev dependencies are not installed ([@jelhan](https://github.com/jelhan)) 102 | 103 | #### :house: Internal 104 | * [#4](https://github.com/jelhan/create-github-actions-setup-for-ember-addon/pull/4) add scenarios for Ember LTS version since 3.4 ([@jelhan](https://github.com/jelhan)) 105 | 106 | #### Committers: 1 107 | - Jeldrik Hanschke ([@jelhan](https://github.com/jelhan)) 108 | 109 | ## v0.1.0 (2020-11-22) 110 | 111 | Initial release 112 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How To Contribute 2 | 3 | ## Installation 4 | 5 | - `git clone https://github.com/jelhan/create-github-actions-setup-for-ember-addon.git` 6 | - `cd create-github-actions-setup-for-ember-addon` 7 | - `yarn install` 8 | 9 | ## Architecture 10 | 11 | GitHub Actions CI workflow is created based on a template writen in [EJS](https://ejs.co/). 12 | It's located in `templates/.github/workflows/ci.yml`. 13 | 14 | A configuration object is used to generate a concrete workflow based on the 15 | template. It is defined by `ConfigurationInterface`. 16 | 17 | The data used is extracted from existing configuration files in the project. 18 | The utility functions responsible for parsing existing configurations are 19 | called parser. They are located in `src/parser/`. So far only TravisCI 20 | configuration (`.travis.yml`) is supported. 21 | 22 | If no configuration file supported by any available parser is found, default 23 | values are used. 24 | 25 | ## Running latest development 26 | 27 | The project is written in TypeScript. To use latest development you must first 28 | compile the code to JavaScript. Run `yarn compile` to do so. 29 | 30 | Afterwards you can run latest development on any project. To do so change 31 | current working directory to the project and afterwards execute the script 32 | using a local path: 33 | `/path/to/create-github-actions-setup-for-ember-addon/bin/create-github-actions-setup-for-ember-addon` 34 | 35 | ## Linting 36 | 37 | The project uses ESLint for linting and Prettier for code formatting. Prettier 38 | is integrated as an ESLint plugin. 39 | 40 | Execute `yarn lint` to run linting and `yarn lint --fix` to automatically fix 41 | linting issues. The latter is especially helpful to prettify the code. 42 | 43 | ## Running tests 44 | 45 | The tests are executed with `yarn test`. The command also takes care of 46 | compiling the TypeScript to JavaScript before executing the script. 47 | 48 | The Tests are written with [jest](https://jestjs.io/). 49 | 50 | The tests use [snapshot testing](https://jestjs.io/docs/en/snapshot-testing). 51 | A snapshot of the created GitHub Actions CI workflow is created for each test 52 | scenario. It's compared against snapshots created before. The snapshots are 53 | checked into the repository and located at `tests/acceptance/__snapshots__`. 54 | 55 | The snaphot-based tests are expected to fail whenever the created GitHub 56 | Actions CI workflow changes. In many cases that changes may be expected. If so 57 | the snapshots must be updated. Run `yarn test -u` to do so. 58 | 59 | Please double check that all changes to snapshots are as expected by your 60 | change before committing the changes. 61 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Create GitHub Actions setup for Ember Addon 2 | 3 | Creates GitHub Actions for Ember Addon with NPM init / yarn create command. 4 | 5 | > This is early alpha software. Use with care and double check the generated GitHub Actions workflow. 6 | 7 | ## Features 8 | 9 | - Update an existing GitHub Actions workflow to latest blueprints using configuration from last run. 10 | - Analyse an existing TravisCI configuration and migrate it over to GitHub Actions. 11 | - Calculate reasonable defaults based on your project. 12 | 13 | ## Usage 14 | 15 | ```sh 16 | # in a yarn repo 17 | yarn create github-actions-setup-for-ember-addon 18 | 19 | # in an npm repo 20 | npm init github-actions-setup-for-ember-addon 21 | ``` 22 | 23 | The configuration to be used depends on the repository. It is determined using this algorithm: 24 | 25 | 1. Use configuration persisted in `.github/workflows/ci.yml` by a previous run if exists. 26 | 2. Analyse `.travis.yml` if one exist. 27 | 3. Fallback to defaults. 28 | 29 | ## Defaults 30 | 31 | The script tries to calculate sensitive defaults if no configuration from a previous run nor an existing `.travis.yml` is found. 32 | The defaults are calculated based on the actual project: 33 | 34 | - Determines node version based on minimum allowed version on `engines.node` key of project's `package.json`. 35 | - Picks up package manager used by your project based on existence of either `package-lock.json` or `yarn.lock`. 36 | - Includes all Ember Try scenarios defined in `config/ember-try.js` in generated test matrix. 37 | - Configures CI to run test against all browsers configured in Testem's `launch_in_ci` configuration. 38 | 39 | ## Limitations of Travis CI parser 40 | 41 | - Only supports TravisCI configuration following the schema used by Ember CLI >= 3.4. 42 | - Environment variables used in TravisCI pipelines are not migrated (yet). 43 | - Customizations of `before_install` or `script` steps are not migrated (yet). 44 | 45 | ## Contributing 46 | 47 | Merge requests are very much appreciated. Parts that could be improved are: 48 | 49 | - The generated GitHub Actions workflow may not reflect latest best practices. 50 | - The script is only tested against TravisCI configurations created by recent Ember CLI versions so far. Extending that test coverage (and fixing bugs) would be great. 51 | - Only a very limited subset of common customizations of the default TravisCI configuration is supported. Would love to support more common patterns. 52 | - The script could be extended to allow the user to set configuration variables with command line flags rather than extracting them from an existing TravisCI configuration. 53 | 54 | Contributing documentation is provided in [CONTRIBUTING.md](CONTRIBUTING.md) 55 | to lower entry barrier. In case you face additional questions do not hesitate 56 | to either open an issue or contact me (@jelhan) on 57 | [Ember Community Discord](https://discord.gg/emberjs). 58 | 59 | ## License 60 | 61 | This project is licensed under the [MIT License](LICENSE.md). 62 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Release Process 2 | 3 | Releases are mostly automated using 4 | [release-it](https://github.com/release-it/release-it/) and 5 | [lerna-changelog](https://github.com/lerna/lerna-changelog/). 6 | 7 | ## Preparation 8 | 9 | Since the majority of the actual release process is automated, the primary 10 | remaining task prior to releasing is confirming that all pull requests that 11 | have been merged since the last release have been labeled with the appropriate 12 | `lerna-changelog` labels and the titles have been updated to ensure they 13 | represent something that would make sense to our users. Some great information 14 | on why this is important can be found at 15 | [keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall 16 | guiding principle here is that changelogs are for humans, not machines. 17 | 18 | When reviewing merged PR's the labels to be used are: 19 | 20 | * breaking - Used when the PR is considered a breaking change. 21 | * enhancement - Used when the PR adds a new feature or enhancement. 22 | * bug - Used when the PR fixes a bug included in a previous release. 23 | * documentation - Used when the PR adds or updates documentation. 24 | * internal - Used for internal changes that still require a mention in the 25 | changelog/release notes. 26 | 27 | ## Release 28 | 29 | Once the prep work is completed, the actual release is straight forward: 30 | 31 | * First, ensure that you have installed your projects dependencies: 32 | 33 | ```sh 34 | yarn install 35 | ``` 36 | 37 | * Second, ensure that you have obtained a 38 | [GitHub personal access token][generate-token] with the `repo` scope (no 39 | other permissions are needed). Make sure the token is available as the 40 | `GITHUB_AUTH` environment variable. 41 | 42 | For instance: 43 | 44 | ```bash 45 | export GITHUB_AUTH=abc123def456 46 | ``` 47 | 48 | [generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable 49 | 50 | * And last (but not least 😁) do your release. 51 | 52 | ```sh 53 | npx release-it 54 | ``` 55 | 56 | [release-it](https://github.com/release-it/release-it/) manages the actual 57 | release process. It will prompt you to to choose the version number after which 58 | you will have the chance to hand tweak the changelog to be used (for the 59 | `CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging, 60 | pushing the tag and commits, etc. 61 | -------------------------------------------------------------------------------- /bin/create-github-actions-setup-for-ember-addon: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require('../dist/index'); 4 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'node', 4 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-github-actions-setup-for-ember-addon", 3 | "version": "0.7.0", 4 | "description": "Setup GitHub Actions for an Ember Addon", 5 | "repository": "https://github.com/jelhan/create-github-actions-setup-for-ember-addon.git", 6 | "license": "MIT", 7 | "author": "Jeldrik Hanschke ", 8 | "main": "dist/index.js", 9 | "bin": { 10 | "create-github-actions-setup-for-ember-addon": "./bin/create-github-actions-setup-for-ember-addon" 11 | }, 12 | "scripts": { 13 | "compile": "tsc", 14 | "lint": "eslint '*/**/*.{js,ts}'", 15 | "prepare": "tsc", 16 | "test": "tsc && jest" 17 | }, 18 | "dependencies": { 19 | "debug": "^4.3.1", 20 | "ejs": "^3.1.5", 21 | "js-yaml": "^3.14.0", 22 | "semver": "^7.3.4" 23 | }, 24 | "devDependencies": { 25 | "@tsconfig/node12": "^1.0.7", 26 | "@types/debug": "^4.1.5", 27 | "@types/ejs": "^3.0.5", 28 | "@types/fs-extra": "^9.0.6", 29 | "@types/jest": "^26.0.15", 30 | "@types/node": "^14.14.9", 31 | "@types/semver": "^7.3.4", 32 | "@typescript-eslint/eslint-plugin": "^4.8.1", 33 | "@typescript-eslint/parser": "^4.8.1", 34 | "eslint": "^7.14.0", 35 | "eslint-config-prettier": "^7.1.0", 36 | "eslint-plugin-jest": "^24.1.3", 37 | "eslint-plugin-prettier": "^3.1.4", 38 | "fs-extra": "^9.0.1", 39 | "jest": "^26.6.3", 40 | "jest-plugin-fs": "^2.9.0", 41 | "prettier": "^2.2.0", 42 | "release-it": "^14.2.1", 43 | "release-it-lerna-changelog": "^3.1.0", 44 | "ts-jest": "^26.4.4", 45 | "ts-node": "^9.0.0", 46 | "typescript": "^4.1.2" 47 | }, 48 | "engines": { 49 | "node": "12.x || >=14" 50 | }, 51 | "publishConfig": { 52 | "registry": "https://registry.npmjs.org" 53 | }, 54 | "release-it": { 55 | "plugins": { 56 | "release-it-lerna-changelog": { 57 | "infile": "CHANGELOG.md", 58 | "launchEditor": true 59 | } 60 | }, 61 | "git": { 62 | "tagName": "v${version}" 63 | }, 64 | "github": { 65 | "release": true, 66 | "tokenRef": "GITHUB_AUTH" 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { debug, determineConfiguration } from './utils'; 2 | import ejs from 'ejs'; 3 | import fs from 'fs'; 4 | import path from 'path'; 5 | import process from 'process'; 6 | import yaml from 'js-yaml'; 7 | 8 | interface EmberTryScenario { 9 | scenario: string; 10 | } 11 | 12 | interface ConfigurationInterface { 13 | browsers: string[]; 14 | emberTryScenarios: EmberTryScenario[]; 15 | nodeVersion: string; 16 | packageManager: 'npm' | 'yarn'; 17 | } 18 | 19 | (async function main() { 20 | const gitHubActionsWorkflowFile = path.join( 21 | process.cwd(), 22 | '.github', 23 | 'workflows', 24 | 'ci.yml' 25 | ); 26 | 27 | const templateFile = path.join( 28 | __dirname, 29 | '..', 30 | 'templates', 31 | '.github', 32 | 'workflows', 33 | 'ci.yml' 34 | ); 35 | const configuration: ConfigurationInterface = await determineConfiguration(); 36 | const data = Object.assign( 37 | { configurationDump: yaml.safeDump(configuration) }, 38 | configuration 39 | ); 40 | const options = { 41 | // debug: true, 42 | }; 43 | 44 | ejs.renderFile(templateFile, data, options, function (err, str) { 45 | if (err) { 46 | throw err; 47 | } 48 | 49 | debug(`Writing GitHub Actions workflow to ${gitHubActionsWorkflowFile}`); 50 | fs.mkdirSync(path.dirname(gitHubActionsWorkflowFile), { recursive: true }); 51 | fs.writeFileSync(gitHubActionsWorkflowFile, str); 52 | }); 53 | })(); 54 | 55 | export { ConfigurationInterface, EmberTryScenario }; 56 | -------------------------------------------------------------------------------- /src/parser/defaults.ts: -------------------------------------------------------------------------------- 1 | import { ConfigurationInterface, EmberTryScenario } from '../index'; 2 | import { existsSync, readFileSync } from 'fs'; 3 | import { major as semverMajor, minVersion as semverMinVersion } from 'semver'; 4 | import path from 'path'; 5 | 6 | /** 7 | * Determines minimum supported node version by parsing `engines.node` value 8 | * from project's `package.json`. 9 | */ 10 | function determineNodeVersion(): string { 11 | let packageJson; 12 | try { 13 | packageJson = JSON.parse( 14 | readFileSync('package.json', { encoding: 'utf-8' }) 15 | ); 16 | } catch (error) { 17 | throw new Error( 18 | 'Could not read package.json. Please double-check that current working ' + 19 | 'dir is the root folder of your project.' 20 | ); 21 | } 22 | 23 | const supportedNodeRange = packageJson?.engines?.node; 24 | if (typeof supportedNodeRange !== 'string') { 25 | throw new Error( 26 | 'Unable to determine supported node version. Package.json seems to miss ' + 27 | '`engines.node` key.' 28 | ); 29 | } 30 | 31 | const minSupportedNodeVersion = semverMinVersion(supportedNodeRange); 32 | if (!minSupportedNodeVersion) { 33 | throw new Error( 34 | 'Unable to determine supported node version. Failed to parse `engines.node` ' + 35 | `value from package.json as semver. It is ${supportedNodeRange}.` 36 | ); 37 | } 38 | 39 | return semverMajor(minSupportedNodeVersion).toString(); 40 | } 41 | 42 | /** 43 | * Determines package manager used by project by existence of either 44 | * package-lock.json or yarn.lock. 45 | */ 46 | function determinePackageManager() { 47 | const isNPM = existsSync('package-lock.json'); 48 | const isYarn = existsSync('yarn.lock'); 49 | 50 | if (isNPM && isYarn) { 51 | throw new Error( 52 | 'Unable to determine package manager. Project seems to have both package-lock.json and yarn.lock.' 53 | ); 54 | } 55 | 56 | if (!isNPM && !isYarn) { 57 | throw new Error( 58 | 'Unable to determine package manager. Project seems to have neither package-lock.json nor yarn.lock' 59 | ); 60 | } 61 | 62 | return isNPM ? 'npm' : 'yarn'; 63 | } 64 | 65 | /** 66 | * Determines browsers supported by project based on testem.js configuration. 67 | */ 68 | async function determineBrowsers(): Promise { 69 | let testemConfiguration; 70 | try { 71 | testemConfiguration = await import(path.join(process.cwd(), 'testem.js')); 72 | } catch (error) { 73 | throw new Error( 74 | 'Could not calculate testem configuration. Please double-check that current working ' + 75 | `dir is the root folder of your project.\n${error}` 76 | ); 77 | } 78 | 79 | return testemConfiguration?.launch_in_ci ?? ['chrome']; 80 | } 81 | 82 | async function determineEmberTryScenarios(): Promise { 83 | let emberTryConfiguration; 84 | try { 85 | const { default: getEmberTryConfiguration } = (await import( 86 | path.join(process.cwd(), 'config', 'ember-try.js') 87 | )) as { 88 | default: () => { name: string; scenarios: Array<{ name: string }> }; 89 | }; 90 | emberTryConfiguration = await getEmberTryConfiguration(); 91 | } catch (error) { 92 | throw new Error( 93 | 'Could not determine Ember Try scenarios. Please double-check\n' + 94 | ' 1) that current working dir is the root folder of your project and\n' + 95 | ' 2) that all dependencies imported in config/ember-try.js are installed.\n' + 96 | `Error message:\n ${error}` 97 | ); 98 | } 99 | 100 | return ( 101 | emberTryConfiguration?.scenarios?.map( 102 | ({ name }: { name: string }): EmberTryScenario => { 103 | return { 104 | scenario: name, 105 | }; 106 | } 107 | ) ?? [] 108 | ); 109 | } 110 | 111 | export default async function (): Promise { 112 | return { 113 | browsers: await determineBrowsers(), 114 | emberTryScenarios: await determineEmberTryScenarios(), 115 | nodeVersion: determineNodeVersion(), 116 | packageManager: determinePackageManager(), 117 | }; 118 | } 119 | -------------------------------------------------------------------------------- /src/parser/previous-run.ts: -------------------------------------------------------------------------------- 1 | import { ConfigurationInterface } from '../index'; 2 | import debug from '../utils/debug'; 3 | import fs from 'fs'; 4 | import path from 'path'; 5 | import yaml from 'js-yaml'; 6 | 7 | export default async function parsePreviousRunConfig(): Promise { 8 | const gitHubActionFile = path.join(process.cwd(), '.github/workflows/ci.yml'); 9 | 10 | debug( 11 | `Looking for configuration in an existing GitHub Actions workflow at ${gitHubActionFile}` 12 | ); 13 | 14 | let gitHubAction; 15 | try { 16 | gitHubAction = fs.readFileSync(gitHubActionFile, { encoding: 'utf-8' }); 17 | } catch (error) { 18 | if (error.code === 'ENOENT') { 19 | debug('No existing GitHub Actions workflow found'); 20 | return null; 21 | } 22 | 23 | throw error; 24 | } 25 | 26 | const previousConfigString = gitHubAction 27 | .split('\n') 28 | .filter((_) => _.startsWith('#$')) 29 | .map((_) => _.substr(2)) 30 | .join('\n'); 31 | if (previousConfigString === '') { 32 | debug( 33 | `GitHub Actions workflow does not seem to contain configuration used in previous run` 34 | ); 35 | return null; 36 | } 37 | 38 | const previousConfig = yaml.safeLoad(previousConfigString); 39 | if (previousConfig === null || typeof previousConfig !== 'object') { 40 | debug( 41 | `Unable to parse configuration used in previous run: ${previousConfigString}` 42 | ); 43 | return null; 44 | } 45 | 46 | const { 47 | browsers, 48 | emberTryScenarios, 49 | nodeVersion, 50 | packageManager, 51 | } = previousConfig; 52 | 53 | if (!['npm', 'yarn'].includes(packageManager)) { 54 | // TODO: warn 55 | debug( 56 | `Previous configuration includes invalid package manager ${packageManager}.` 57 | ); 58 | return null; 59 | } 60 | 61 | if (!Array.isArray(browsers)) { 62 | // TODO: warn 63 | debug( 64 | `Previous configuration includes an invalid value for browsers. It should be a collection but is ${typeof browsers}` 65 | ); 66 | } 67 | 68 | return { 69 | browsers, 70 | emberTryScenarios, 71 | nodeVersion, 72 | packageManager, 73 | }; 74 | } 75 | -------------------------------------------------------------------------------- /src/parser/travis-ci.ts: -------------------------------------------------------------------------------- 1 | import { ConfigurationInterface, EmberTryScenario } from '../index'; 2 | import debug from '../utils/debug'; 3 | import fs from 'fs'; 4 | import path from 'path'; 5 | import process from 'process'; 6 | import yaml from 'js-yaml'; 7 | 8 | function determinePackageManager(config: { 9 | jobs?: { 10 | include?: { 11 | script?: string[]; 12 | }[]; 13 | }; 14 | }): 'npm' | 'yarn' { 15 | for (const jobDescription of config.jobs?.include ?? []) { 16 | const { script } = jobDescription; 17 | 18 | for (const command of script ?? []) { 19 | if (command.startsWith('npm')) { 20 | return 'npm'; 21 | } 22 | 23 | if (command.startsWith('yarn')) { 24 | return 'yarn'; 25 | } 26 | } 27 | } 28 | 29 | throw new Error( 30 | 'Could not determine a supported package manager from TravisCI configuration' 31 | ); 32 | } 33 | 34 | export default async function parseTravisCiConfig(): Promise { 35 | const configFile = path.join(process.cwd(), '.travis.yml'); 36 | 37 | debug(`Looking for TravisCI configuration at ${configFile}`); 38 | 39 | let configString; 40 | try { 41 | configString = fs.readFileSync(configFile, { encoding: 'utf-8' }); 42 | } catch (error) { 43 | if (error.code === 'ENOENT') { 44 | debug('No TravisCI configuration found'); 45 | return null; 46 | } 47 | 48 | throw error; 49 | } 50 | 51 | const config = yaml.safeLoad(configString, { 52 | onWarning: console.log, 53 | }) as { [key: string]: any } | string | undefined; 54 | 55 | if (typeof config !== 'object') { 56 | console.error(config); 57 | throw new Error('Parsing .travis.yml failed'); 58 | } 59 | 60 | const browsers = ['chrome', 'firefox'].filter((_) => 61 | Object.keys(config.addons).includes(_) 62 | ); 63 | const nodeVersion = `${config.node_js?.[0]}.x`; 64 | 65 | const emberTryScenarios: EmberTryScenario[] = config.jobs.include 66 | .map(({ env }: { env: unknown }) => { 67 | if (typeof env !== 'string') { 68 | return null; 69 | } 70 | 71 | const [key, value] = env.split('='); 72 | 73 | if (key !== 'EMBER_TRY_SCENARIO') { 74 | return null; 75 | } 76 | 77 | return { 78 | scenario: value, 79 | }; 80 | }) 81 | .filter((_: string | null) => _ !== null); 82 | 83 | const packageManager: 'npm' | 'yarn' = determinePackageManager(config); 84 | 85 | return { 86 | browsers, 87 | emberTryScenarios, 88 | nodeVersion, 89 | packageManager, 90 | }; 91 | } 92 | -------------------------------------------------------------------------------- /src/utils/debug.ts: -------------------------------------------------------------------------------- 1 | import createDebug from 'debug'; 2 | 3 | export default createDebug('create-github-actions-setup-for-ember-addon'); 4 | -------------------------------------------------------------------------------- /src/utils/determine-configuration.ts: -------------------------------------------------------------------------------- 1 | import { ConfigurationInterface } from '../index'; 2 | import debug from './debug'; 3 | import parseTravisCiConfig from '../parser/travis-ci'; 4 | import parsePreviosRunConfig from '../parser/previous-run'; 5 | import calculateDefaults from '../parser/defaults'; 6 | 7 | interface Parser { 8 | name: string; 9 | parse: { (): Promise }; 10 | } 11 | 12 | const parsers: Parser[] = [ 13 | { 14 | name: 'TravisCI', 15 | parse: parseTravisCiConfig, 16 | }, 17 | { 18 | name: 'Previous Run', 19 | parse: parsePreviosRunConfig, 20 | }, 21 | { 22 | name: 'Defaults', 23 | parse: calculateDefaults, 24 | }, 25 | ]; 26 | 27 | export default async function determineConfiguration(): Promise { 28 | for (const parser of parsers) { 29 | const { name, parse } = parser; 30 | 31 | debug(`Trying parser ${name}`); 32 | const config = await parse(); 33 | 34 | if (config === null) { 35 | continue; 36 | } 37 | 38 | console.log(`Using configuration from ${name}`); 39 | return config; 40 | } 41 | 42 | throw new Error( 43 | 'Unable to determine any configuration. Defaults should have been used as a last fallback. Please report this bug.' 44 | ); 45 | } 46 | -------------------------------------------------------------------------------- /src/utils/index.ts: -------------------------------------------------------------------------------- 1 | import debug from './debug'; 2 | import determineConfiguration from './determine-configuration'; 3 | 4 | export { debug, determineConfiguration }; 5 | -------------------------------------------------------------------------------- /templates/.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by create-github-actions-setup-for-ember-addon. 2 | # 3 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 4 | # by Create GitHub Actions setup for Ember Addons by running it again: 5 | # 6 | # - `yarn create github-actions-setup-for-ember-addon` if using yarn and 7 | # - `npm init github-actions-setup-for-ember-addon` if using NPM. 8 | # 9 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 10 | # details. 11 | # 12 | # The following lines contain the configuration used in the last run. Please do 13 | # not change them. Doing so could break upgrade flow. 14 | # 15 | <%- configurationDump.trim().replace(/^/mg, "#$ ") %> 16 | # 17 | 18 | name: CI 19 | 20 | on: 21 | push: 22 | branches: 23 | - master 24 | pull_request: 25 | 26 | env: 27 | NODE_VERSION: '<%- nodeVersion %>' 28 | 29 | jobs: 30 | lint: 31 | name: Lint 32 | runs-on: ubuntu-latest 33 | steps: 34 | - uses: actions/checkout@v2 35 | with: 36 | fetch-depth: 1 37 | 38 | - uses: actions/setup-node@v2-beta 39 | with: 40 | node-version: '${{ env.NODE_VERSION }}' 41 | 42 | - name: Get package manager's global cache path 43 | id: global-cache-dir-path 44 | run: echo "::set-output name=dir::$(<% 45 | if (packageManager === 'npm') { 46 | %>npm config get cache<% 47 | } else { 48 | %>yarn cache dir<% 49 | } %>)" 50 | 51 | - name: Cache package manager's global cache and node_modules 52 | id: cache-dependencies 53 | uses: actions/cache@v2 54 | with: 55 | path: | 56 | ${{ steps.global-cache-dir-path.outputs.dir }} 57 | node_modules 58 | key: ${{ runner.os }}-${{ matrix.node-version }}-${{ 59 | hashFiles('**/<% 60 | if (packageManager === 'npm') { 61 | %>package-lock.json<% 62 | } else { 63 | %>yarn.lock<% 64 | } %>' 65 | ) }} 66 | restore-keys: | 67 | ${{ runner.os }}-${{ matrix.node-version }}- 68 | 69 | - name: Install Dependencies 70 | run: <% 71 | if (packageManager === 'npm') { 72 | %>npm ci<% 73 | } else { 74 | %>yarn install --frozen-lockfile<% 75 | } %> 76 | if: | 77 | steps.cache-dependencies.outputs.cache-hit != 'true' 78 | 79 | - name: Lint 80 | run: <% if (packageManager === 'npm') { %>npm run-script<% } else { %>yarn<% } %> lint 81 | 82 | 83 | test: 84 | name: Tests 85 | runs-on: ${{ matrix.os }} 86 | needs: lint 87 | 88 | strategy: 89 | matrix: 90 | os: [ubuntu-latest] 91 | browser: [<%- browsers.join(', ') %>] 92 | 93 | steps: 94 | - uses: actions/checkout@v2 95 | with: 96 | fetch-depth: 1 97 | 98 | - uses: actions/setup-node@v2-beta 99 | with: 100 | node-version: '${{ env.NODE_VERSION }}' 101 | 102 | - name: Get package manager's global cache path 103 | id: global-cache-dir-path 104 | run: echo "::set-output name=dir::$(<% 105 | if (packageManager === 'npm') { 106 | %>npm config get cache<% 107 | } else { 108 | %>yarn cache dir<% 109 | } %>)" 110 | 111 | - name: Cache package manager's global cache and node_modules 112 | id: cache-dependencies 113 | uses: actions/cache@v2 114 | with: 115 | path: | 116 | ${{ steps.global-cache-dir-path.outputs.dir }} 117 | node_modules 118 | key: ${{ runner.os }}-${{ matrix.node-version }}-${{ 119 | hashFiles('**/<% 120 | if (packageManager === 'npm') { 121 | %>package-lock.json<% 122 | } else { 123 | %>yarn.lock<% 124 | } %>' 125 | ) }} 126 | restore-keys: | 127 | ${{ runner.os }}-${{ matrix.node-version }}- 128 | 129 | - name: Install Dependencies 130 | run: <% 131 | if (packageManager === 'npm') { 132 | %>npm ci<% 133 | } else { 134 | %>yarn install --frozen-lockfile<% 135 | } %> 136 | if: | 137 | steps.cache-dependencies.outputs.cache-hit != 'true' 138 | 139 | - name: Test 140 | run: <% if (packageManager === 'npm') { %>npm run-script<% } else { %>yarn<% } %> test:ember --launch ${{ matrix.browser }} 141 | 142 | 143 | floating-dependencies: 144 | name: Floating Dependencies 145 | runs-on: ${{ matrix.os }} 146 | needs: lint 147 | 148 | strategy: 149 | matrix: 150 | os: [ubuntu-latest] 151 | browser: [<%- browsers.join(', ') %>] 152 | 153 | steps: 154 | - uses: actions/checkout@v2 155 | with: 156 | fetch-depth: 1 157 | 158 | - uses: actions/setup-node@v2-beta 159 | with: 160 | node-version: '${{ env.NODE_VERSION }}' 161 | 162 | - name: Get package manager's global cache path 163 | id: global-cache-dir-path 164 | run: echo "::set-output name=dir::$(<% 165 | if (packageManager === 'npm') { 166 | %>npm config get cache<% 167 | } else { 168 | %>yarn cache dir<% 169 | } %>)" 170 | 171 | - name: Cache package manager's global cache and node_modules 172 | id: cache-dependencies 173 | uses: actions/cache@v2 174 | with: 175 | path: | 176 | ${{ steps.global-cache-dir-path.outputs.dir }} 177 | node_modules 178 | key: ${{ runner.os }}-${{ matrix.node-version }}-floating-deps 179 | restore-keys: | 180 | ${{ runner.os }}-${{ matrix.node-version }}- 181 | 182 | - name: Install Dependencies 183 | run: <% 184 | if (packageManager === 'npm') { 185 | %>npm install --no-package-lock<% 186 | } else { 187 | %>yarn install --no-lockfile --non-interactive<% 188 | } %> 189 | 190 | - name: Test 191 | run: <% if (packageManager === 'npm') { %>npm run-script<% } else { %>yarn<% } %> test:ember --launch ${{ matrix.browser }} 192 | 193 | 194 | try-scenarios: 195 | name: Tests - ${{ matrix.ember-try-scenario }} 196 | runs-on: ubuntu-latest 197 | continue-on-error: true 198 | needs: test 199 | 200 | strategy: 201 | fail-fast: true 202 | matrix: 203 | ember-try-scenario: [<% 204 | emberTryScenarios 205 | .forEach(function({ scenario }, index, requiredEmberTryScenarios) { 206 | const isLastElement = requiredEmberTryScenarios.length - 1 === index; %> 207 | <%- scenario %><% if (!isLastElement) { %>,<% } 208 | }); %> 209 | ] 210 | 211 | steps: 212 | - uses: actions/checkout@v2 213 | with: 214 | fetch-depth: 1 215 | 216 | - uses: actions/setup-node@v2-beta 217 | with: 218 | node-version: '${{ env.NODE_VERSION }}' 219 | 220 | - name: Get package manager's global cache path 221 | id: global-cache-dir-path 222 | run: echo "::set-output name=dir::$(<% 223 | if (packageManager === 'npm') { 224 | %>npm config get cache<% 225 | } else { 226 | %>yarn cache dir<% 227 | } %>)" 228 | 229 | - name: Cache package manager's global cache and node_modules 230 | id: cache-dependencies 231 | uses: actions/cache@v2 232 | with: 233 | path: | 234 | ${{ steps.global-cache-dir-path.outputs.dir }} 235 | node_modules 236 | key: ${{ runner.os }}-${{ matrix.node-version }}-${{ 237 | hashFiles('**/<% 238 | if (packageManager === 'npm') { 239 | %>package-lock.json<% 240 | } else { 241 | %>yarn.lock<% 242 | } %>' 243 | ) }} 244 | restore-keys: | 245 | ${{ runner.os }}-${{ matrix.node-version }}- 246 | 247 | - name: Install Dependencies 248 | run: <% 249 | if (packageManager === 'npm') { 250 | %>npm ci<% 251 | } else { 252 | %>yarn install --frozen-lockfile<% 253 | } %> 254 | if: | 255 | steps.cache-dependencies.outputs.cache-hit != 'true' 256 | 257 | - name: Test 258 | env: 259 | EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }} 260 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 261 | -------------------------------------------------------------------------------- /tests/acceptance/__snapshots__/creates-github-actions.test.ts.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`creates GitHub Actions setup migrates existing TravisCI configration supports scenario .travis.yml.ember-3.4-npm 1`] = ` 4 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 5 | # 6 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 7 | # by Create GitHub Actions setup for Ember Addons by running it again: 8 | # 9 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 10 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 11 | # 12 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 13 | # details. 14 | # 15 | # The following lines contain the configuration used in the last run. Please do 16 | # not change them. Doing so could break upgrade flow. 17 | # 18 | #$ browsers: 19 | #$ - chrome 20 | #$ emberTryScenarios: 21 | #$ - scenario: ember-lts-2.16 22 | #$ - scenario: ember-lts-2.18 23 | #$ - scenario: ember-release 24 | #$ - scenario: ember-beta 25 | #$ - scenario: ember-canary 26 | #$ - scenario: ember-default-with-jquery 27 | #$ nodeVersion: 6.x 28 | #$ packageManager: npm 29 | # 30 | 31 | name: CI 32 | 33 | on: 34 | push: 35 | branches: 36 | - master 37 | pull_request: 38 | 39 | env: 40 | NODE_VERSION: '6.x' 41 | 42 | jobs: 43 | lint: 44 | name: Lint 45 | runs-on: ubuntu-latest 46 | steps: 47 | - uses: actions/checkout@v2 48 | with: 49 | fetch-depth: 1 50 | 51 | - uses: actions/setup-node@v2-beta 52 | with: 53 | node-version: '\${{ env.NODE_VERSION }}' 54 | 55 | - name: Get package manager's global cache path 56 | id: global-cache-dir-path 57 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 58 | 59 | - name: Cache package manager's global cache and node_modules 60 | id: cache-dependencies 61 | uses: actions/cache@v2 62 | with: 63 | path: | 64 | \${{ steps.global-cache-dir-path.outputs.dir }} 65 | node_modules 66 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 67 | hashFiles('**/package-lock.json' 68 | ) }} 69 | restore-keys: | 70 | \${{ runner.os }}-\${{ matrix.node-version }}- 71 | 72 | - name: Install Dependencies 73 | run: npm ci 74 | if: | 75 | steps.cache-dependencies.outputs.cache-hit != 'true' 76 | 77 | - name: Lint 78 | run: npm run-script lint 79 | 80 | 81 | test: 82 | name: Tests 83 | runs-on: \${{ matrix.os }} 84 | needs: lint 85 | 86 | strategy: 87 | matrix: 88 | os: [ubuntu-latest] 89 | browser: [chrome] 90 | 91 | steps: 92 | - uses: actions/checkout@v2 93 | with: 94 | fetch-depth: 1 95 | 96 | - uses: actions/setup-node@v2-beta 97 | with: 98 | node-version: '\${{ env.NODE_VERSION }}' 99 | 100 | - name: Get package manager's global cache path 101 | id: global-cache-dir-path 102 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 103 | 104 | - name: Cache package manager's global cache and node_modules 105 | id: cache-dependencies 106 | uses: actions/cache@v2 107 | with: 108 | path: | 109 | \${{ steps.global-cache-dir-path.outputs.dir }} 110 | node_modules 111 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 112 | hashFiles('**/package-lock.json' 113 | ) }} 114 | restore-keys: | 115 | \${{ runner.os }}-\${{ matrix.node-version }}- 116 | 117 | - name: Install Dependencies 118 | run: npm ci 119 | if: | 120 | steps.cache-dependencies.outputs.cache-hit != 'true' 121 | 122 | - name: Test 123 | run: npm run-script test:ember --launch \${{ matrix.browser }} 124 | 125 | 126 | floating-dependencies: 127 | name: Floating Dependencies 128 | runs-on: \${{ matrix.os }} 129 | needs: lint 130 | 131 | strategy: 132 | matrix: 133 | os: [ubuntu-latest] 134 | browser: [chrome] 135 | 136 | steps: 137 | - uses: actions/checkout@v2 138 | with: 139 | fetch-depth: 1 140 | 141 | - uses: actions/setup-node@v2-beta 142 | with: 143 | node-version: '\${{ env.NODE_VERSION }}' 144 | 145 | - name: Get package manager's global cache path 146 | id: global-cache-dir-path 147 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 148 | 149 | - name: Cache package manager's global cache and node_modules 150 | id: cache-dependencies 151 | uses: actions/cache@v2 152 | with: 153 | path: | 154 | \${{ steps.global-cache-dir-path.outputs.dir }} 155 | node_modules 156 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 157 | restore-keys: | 158 | \${{ runner.os }}-\${{ matrix.node-version }}- 159 | 160 | - name: Install Dependencies 161 | run: npm install --no-package-lock 162 | 163 | - name: Test 164 | run: npm run-script test:ember --launch \${{ matrix.browser }} 165 | 166 | 167 | try-scenarios: 168 | name: Tests - \${{ matrix.ember-try-scenario }} 169 | runs-on: ubuntu-latest 170 | continue-on-error: true 171 | needs: test 172 | 173 | strategy: 174 | fail-fast: true 175 | matrix: 176 | ember-try-scenario: [ 177 | ember-lts-2.16, 178 | ember-lts-2.18, 179 | ember-release, 180 | ember-beta, 181 | ember-canary, 182 | ember-default-with-jquery 183 | ] 184 | 185 | steps: 186 | - uses: actions/checkout@v2 187 | with: 188 | fetch-depth: 1 189 | 190 | - uses: actions/setup-node@v2-beta 191 | with: 192 | node-version: '\${{ env.NODE_VERSION }}' 193 | 194 | - name: Get package manager's global cache path 195 | id: global-cache-dir-path 196 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 197 | 198 | - name: Cache package manager's global cache and node_modules 199 | id: cache-dependencies 200 | uses: actions/cache@v2 201 | with: 202 | path: | 203 | \${{ steps.global-cache-dir-path.outputs.dir }} 204 | node_modules 205 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 206 | hashFiles('**/package-lock.json' 207 | ) }} 208 | restore-keys: | 209 | \${{ runner.os }}-\${{ matrix.node-version }}- 210 | 211 | - name: Install Dependencies 212 | run: npm ci 213 | if: | 214 | steps.cache-dependencies.outputs.cache-hit != 'true' 215 | 216 | - name: Test 217 | env: 218 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 219 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 220 | " 221 | `; 222 | 223 | exports[`creates GitHub Actions setup migrates existing TravisCI configration supports scenario .travis.yml.ember-3.8-npm 1`] = ` 224 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 225 | # 226 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 227 | # by Create GitHub Actions setup for Ember Addons by running it again: 228 | # 229 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 230 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 231 | # 232 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 233 | # details. 234 | # 235 | # The following lines contain the configuration used in the last run. Please do 236 | # not change them. Doing so could break upgrade flow. 237 | # 238 | #$ browsers: 239 | #$ - chrome 240 | #$ emberTryScenarios: 241 | #$ - scenario: ember-lts-2.18 242 | #$ - scenario: ember-lts-3.4 243 | #$ - scenario: ember-release 244 | #$ - scenario: ember-beta 245 | #$ - scenario: ember-canary 246 | #$ - scenario: ember-default-with-jquery 247 | #$ nodeVersion: 6.x 248 | #$ packageManager: npm 249 | # 250 | 251 | name: CI 252 | 253 | on: 254 | push: 255 | branches: 256 | - master 257 | pull_request: 258 | 259 | env: 260 | NODE_VERSION: '6.x' 261 | 262 | jobs: 263 | lint: 264 | name: Lint 265 | runs-on: ubuntu-latest 266 | steps: 267 | - uses: actions/checkout@v2 268 | with: 269 | fetch-depth: 1 270 | 271 | - uses: actions/setup-node@v2-beta 272 | with: 273 | node-version: '\${{ env.NODE_VERSION }}' 274 | 275 | - name: Get package manager's global cache path 276 | id: global-cache-dir-path 277 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 278 | 279 | - name: Cache package manager's global cache and node_modules 280 | id: cache-dependencies 281 | uses: actions/cache@v2 282 | with: 283 | path: | 284 | \${{ steps.global-cache-dir-path.outputs.dir }} 285 | node_modules 286 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 287 | hashFiles('**/package-lock.json' 288 | ) }} 289 | restore-keys: | 290 | \${{ runner.os }}-\${{ matrix.node-version }}- 291 | 292 | - name: Install Dependencies 293 | run: npm ci 294 | if: | 295 | steps.cache-dependencies.outputs.cache-hit != 'true' 296 | 297 | - name: Lint 298 | run: npm run-script lint 299 | 300 | 301 | test: 302 | name: Tests 303 | runs-on: \${{ matrix.os }} 304 | needs: lint 305 | 306 | strategy: 307 | matrix: 308 | os: [ubuntu-latest] 309 | browser: [chrome] 310 | 311 | steps: 312 | - uses: actions/checkout@v2 313 | with: 314 | fetch-depth: 1 315 | 316 | - uses: actions/setup-node@v2-beta 317 | with: 318 | node-version: '\${{ env.NODE_VERSION }}' 319 | 320 | - name: Get package manager's global cache path 321 | id: global-cache-dir-path 322 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 323 | 324 | - name: Cache package manager's global cache and node_modules 325 | id: cache-dependencies 326 | uses: actions/cache@v2 327 | with: 328 | path: | 329 | \${{ steps.global-cache-dir-path.outputs.dir }} 330 | node_modules 331 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 332 | hashFiles('**/package-lock.json' 333 | ) }} 334 | restore-keys: | 335 | \${{ runner.os }}-\${{ matrix.node-version }}- 336 | 337 | - name: Install Dependencies 338 | run: npm ci 339 | if: | 340 | steps.cache-dependencies.outputs.cache-hit != 'true' 341 | 342 | - name: Test 343 | run: npm run-script test:ember --launch \${{ matrix.browser }} 344 | 345 | 346 | floating-dependencies: 347 | name: Floating Dependencies 348 | runs-on: \${{ matrix.os }} 349 | needs: lint 350 | 351 | strategy: 352 | matrix: 353 | os: [ubuntu-latest] 354 | browser: [chrome] 355 | 356 | steps: 357 | - uses: actions/checkout@v2 358 | with: 359 | fetch-depth: 1 360 | 361 | - uses: actions/setup-node@v2-beta 362 | with: 363 | node-version: '\${{ env.NODE_VERSION }}' 364 | 365 | - name: Get package manager's global cache path 366 | id: global-cache-dir-path 367 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 368 | 369 | - name: Cache package manager's global cache and node_modules 370 | id: cache-dependencies 371 | uses: actions/cache@v2 372 | with: 373 | path: | 374 | \${{ steps.global-cache-dir-path.outputs.dir }} 375 | node_modules 376 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 377 | restore-keys: | 378 | \${{ runner.os }}-\${{ matrix.node-version }}- 379 | 380 | - name: Install Dependencies 381 | run: npm install --no-package-lock 382 | 383 | - name: Test 384 | run: npm run-script test:ember --launch \${{ matrix.browser }} 385 | 386 | 387 | try-scenarios: 388 | name: Tests - \${{ matrix.ember-try-scenario }} 389 | runs-on: ubuntu-latest 390 | continue-on-error: true 391 | needs: test 392 | 393 | strategy: 394 | fail-fast: true 395 | matrix: 396 | ember-try-scenario: [ 397 | ember-lts-2.18, 398 | ember-lts-3.4, 399 | ember-release, 400 | ember-beta, 401 | ember-canary, 402 | ember-default-with-jquery 403 | ] 404 | 405 | steps: 406 | - uses: actions/checkout@v2 407 | with: 408 | fetch-depth: 1 409 | 410 | - uses: actions/setup-node@v2-beta 411 | with: 412 | node-version: '\${{ env.NODE_VERSION }}' 413 | 414 | - name: Get package manager's global cache path 415 | id: global-cache-dir-path 416 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 417 | 418 | - name: Cache package manager's global cache and node_modules 419 | id: cache-dependencies 420 | uses: actions/cache@v2 421 | with: 422 | path: | 423 | \${{ steps.global-cache-dir-path.outputs.dir }} 424 | node_modules 425 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 426 | hashFiles('**/package-lock.json' 427 | ) }} 428 | restore-keys: | 429 | \${{ runner.os }}-\${{ matrix.node-version }}- 430 | 431 | - name: Install Dependencies 432 | run: npm ci 433 | if: | 434 | steps.cache-dependencies.outputs.cache-hit != 'true' 435 | 436 | - name: Test 437 | env: 438 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 439 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 440 | " 441 | `; 442 | 443 | exports[`creates GitHub Actions setup migrates existing TravisCI configration supports scenario .travis.yml.ember-3.12-npm 1`] = ` 444 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 445 | # 446 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 447 | # by Create GitHub Actions setup for Ember Addons by running it again: 448 | # 449 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 450 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 451 | # 452 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 453 | # details. 454 | # 455 | # The following lines contain the configuration used in the last run. Please do 456 | # not change them. Doing so could break upgrade flow. 457 | # 458 | #$ browsers: 459 | #$ - chrome 460 | #$ emberTryScenarios: 461 | #$ - scenario: ember-lts-3.4 462 | #$ - scenario: ember-lts-3.8 463 | #$ - scenario: ember-release 464 | #$ - scenario: ember-beta 465 | #$ - scenario: ember-canary 466 | #$ - scenario: ember-default-with-jquery 467 | #$ nodeVersion: 8.x 468 | #$ packageManager: npm 469 | # 470 | 471 | name: CI 472 | 473 | on: 474 | push: 475 | branches: 476 | - master 477 | pull_request: 478 | 479 | env: 480 | NODE_VERSION: '8.x' 481 | 482 | jobs: 483 | lint: 484 | name: Lint 485 | runs-on: ubuntu-latest 486 | steps: 487 | - uses: actions/checkout@v2 488 | with: 489 | fetch-depth: 1 490 | 491 | - uses: actions/setup-node@v2-beta 492 | with: 493 | node-version: '\${{ env.NODE_VERSION }}' 494 | 495 | - name: Get package manager's global cache path 496 | id: global-cache-dir-path 497 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 498 | 499 | - name: Cache package manager's global cache and node_modules 500 | id: cache-dependencies 501 | uses: actions/cache@v2 502 | with: 503 | path: | 504 | \${{ steps.global-cache-dir-path.outputs.dir }} 505 | node_modules 506 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 507 | hashFiles('**/package-lock.json' 508 | ) }} 509 | restore-keys: | 510 | \${{ runner.os }}-\${{ matrix.node-version }}- 511 | 512 | - name: Install Dependencies 513 | run: npm ci 514 | if: | 515 | steps.cache-dependencies.outputs.cache-hit != 'true' 516 | 517 | - name: Lint 518 | run: npm run-script lint 519 | 520 | 521 | test: 522 | name: Tests 523 | runs-on: \${{ matrix.os }} 524 | needs: lint 525 | 526 | strategy: 527 | matrix: 528 | os: [ubuntu-latest] 529 | browser: [chrome] 530 | 531 | steps: 532 | - uses: actions/checkout@v2 533 | with: 534 | fetch-depth: 1 535 | 536 | - uses: actions/setup-node@v2-beta 537 | with: 538 | node-version: '\${{ env.NODE_VERSION }}' 539 | 540 | - name: Get package manager's global cache path 541 | id: global-cache-dir-path 542 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 543 | 544 | - name: Cache package manager's global cache and node_modules 545 | id: cache-dependencies 546 | uses: actions/cache@v2 547 | with: 548 | path: | 549 | \${{ steps.global-cache-dir-path.outputs.dir }} 550 | node_modules 551 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 552 | hashFiles('**/package-lock.json' 553 | ) }} 554 | restore-keys: | 555 | \${{ runner.os }}-\${{ matrix.node-version }}- 556 | 557 | - name: Install Dependencies 558 | run: npm ci 559 | if: | 560 | steps.cache-dependencies.outputs.cache-hit != 'true' 561 | 562 | - name: Test 563 | run: npm run-script test:ember --launch \${{ matrix.browser }} 564 | 565 | 566 | floating-dependencies: 567 | name: Floating Dependencies 568 | runs-on: \${{ matrix.os }} 569 | needs: lint 570 | 571 | strategy: 572 | matrix: 573 | os: [ubuntu-latest] 574 | browser: [chrome] 575 | 576 | steps: 577 | - uses: actions/checkout@v2 578 | with: 579 | fetch-depth: 1 580 | 581 | - uses: actions/setup-node@v2-beta 582 | with: 583 | node-version: '\${{ env.NODE_VERSION }}' 584 | 585 | - name: Get package manager's global cache path 586 | id: global-cache-dir-path 587 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 588 | 589 | - name: Cache package manager's global cache and node_modules 590 | id: cache-dependencies 591 | uses: actions/cache@v2 592 | with: 593 | path: | 594 | \${{ steps.global-cache-dir-path.outputs.dir }} 595 | node_modules 596 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 597 | restore-keys: | 598 | \${{ runner.os }}-\${{ matrix.node-version }}- 599 | 600 | - name: Install Dependencies 601 | run: npm install --no-package-lock 602 | 603 | - name: Test 604 | run: npm run-script test:ember --launch \${{ matrix.browser }} 605 | 606 | 607 | try-scenarios: 608 | name: Tests - \${{ matrix.ember-try-scenario }} 609 | runs-on: ubuntu-latest 610 | continue-on-error: true 611 | needs: test 612 | 613 | strategy: 614 | fail-fast: true 615 | matrix: 616 | ember-try-scenario: [ 617 | ember-lts-3.4, 618 | ember-lts-3.8, 619 | ember-release, 620 | ember-beta, 621 | ember-canary, 622 | ember-default-with-jquery 623 | ] 624 | 625 | steps: 626 | - uses: actions/checkout@v2 627 | with: 628 | fetch-depth: 1 629 | 630 | - uses: actions/setup-node@v2-beta 631 | with: 632 | node-version: '\${{ env.NODE_VERSION }}' 633 | 634 | - name: Get package manager's global cache path 635 | id: global-cache-dir-path 636 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 637 | 638 | - name: Cache package manager's global cache and node_modules 639 | id: cache-dependencies 640 | uses: actions/cache@v2 641 | with: 642 | path: | 643 | \${{ steps.global-cache-dir-path.outputs.dir }} 644 | node_modules 645 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 646 | hashFiles('**/package-lock.json' 647 | ) }} 648 | restore-keys: | 649 | \${{ runner.os }}-\${{ matrix.node-version }}- 650 | 651 | - name: Install Dependencies 652 | run: npm ci 653 | if: | 654 | steps.cache-dependencies.outputs.cache-hit != 'true' 655 | 656 | - name: Test 657 | env: 658 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 659 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 660 | " 661 | `; 662 | 663 | exports[`creates GitHub Actions setup migrates existing TravisCI configration supports scenario .travis.yml.ember-3.16-npm 1`] = ` 664 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 665 | # 666 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 667 | # by Create GitHub Actions setup for Ember Addons by running it again: 668 | # 669 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 670 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 671 | # 672 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 673 | # details. 674 | # 675 | # The following lines contain the configuration used in the last run. Please do 676 | # not change them. Doing so could break upgrade flow. 677 | # 678 | #$ browsers: 679 | #$ - chrome 680 | #$ emberTryScenarios: 681 | #$ - scenario: ember-lts-3.12 682 | #$ - scenario: ember-lts-3.16 683 | #$ - scenario: ember-release 684 | #$ - scenario: ember-beta 685 | #$ - scenario: ember-canary 686 | #$ - scenario: ember-default-with-jquery 687 | #$ - scenario: ember-classic 688 | #$ nodeVersion: 10.x 689 | #$ packageManager: npm 690 | # 691 | 692 | name: CI 693 | 694 | on: 695 | push: 696 | branches: 697 | - master 698 | pull_request: 699 | 700 | env: 701 | NODE_VERSION: '10.x' 702 | 703 | jobs: 704 | lint: 705 | name: Lint 706 | runs-on: ubuntu-latest 707 | steps: 708 | - uses: actions/checkout@v2 709 | with: 710 | fetch-depth: 1 711 | 712 | - uses: actions/setup-node@v2-beta 713 | with: 714 | node-version: '\${{ env.NODE_VERSION }}' 715 | 716 | - name: Get package manager's global cache path 717 | id: global-cache-dir-path 718 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 719 | 720 | - name: Cache package manager's global cache and node_modules 721 | id: cache-dependencies 722 | uses: actions/cache@v2 723 | with: 724 | path: | 725 | \${{ steps.global-cache-dir-path.outputs.dir }} 726 | node_modules 727 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 728 | hashFiles('**/package-lock.json' 729 | ) }} 730 | restore-keys: | 731 | \${{ runner.os }}-\${{ matrix.node-version }}- 732 | 733 | - name: Install Dependencies 734 | run: npm ci 735 | if: | 736 | steps.cache-dependencies.outputs.cache-hit != 'true' 737 | 738 | - name: Lint 739 | run: npm run-script lint 740 | 741 | 742 | test: 743 | name: Tests 744 | runs-on: \${{ matrix.os }} 745 | needs: lint 746 | 747 | strategy: 748 | matrix: 749 | os: [ubuntu-latest] 750 | browser: [chrome] 751 | 752 | steps: 753 | - uses: actions/checkout@v2 754 | with: 755 | fetch-depth: 1 756 | 757 | - uses: actions/setup-node@v2-beta 758 | with: 759 | node-version: '\${{ env.NODE_VERSION }}' 760 | 761 | - name: Get package manager's global cache path 762 | id: global-cache-dir-path 763 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 764 | 765 | - name: Cache package manager's global cache and node_modules 766 | id: cache-dependencies 767 | uses: actions/cache@v2 768 | with: 769 | path: | 770 | \${{ steps.global-cache-dir-path.outputs.dir }} 771 | node_modules 772 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 773 | hashFiles('**/package-lock.json' 774 | ) }} 775 | restore-keys: | 776 | \${{ runner.os }}-\${{ matrix.node-version }}- 777 | 778 | - name: Install Dependencies 779 | run: npm ci 780 | if: | 781 | steps.cache-dependencies.outputs.cache-hit != 'true' 782 | 783 | - name: Test 784 | run: npm run-script test:ember --launch \${{ matrix.browser }} 785 | 786 | 787 | floating-dependencies: 788 | name: Floating Dependencies 789 | runs-on: \${{ matrix.os }} 790 | needs: lint 791 | 792 | strategy: 793 | matrix: 794 | os: [ubuntu-latest] 795 | browser: [chrome] 796 | 797 | steps: 798 | - uses: actions/checkout@v2 799 | with: 800 | fetch-depth: 1 801 | 802 | - uses: actions/setup-node@v2-beta 803 | with: 804 | node-version: '\${{ env.NODE_VERSION }}' 805 | 806 | - name: Get package manager's global cache path 807 | id: global-cache-dir-path 808 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 809 | 810 | - name: Cache package manager's global cache and node_modules 811 | id: cache-dependencies 812 | uses: actions/cache@v2 813 | with: 814 | path: | 815 | \${{ steps.global-cache-dir-path.outputs.dir }} 816 | node_modules 817 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 818 | restore-keys: | 819 | \${{ runner.os }}-\${{ matrix.node-version }}- 820 | 821 | - name: Install Dependencies 822 | run: npm install --no-package-lock 823 | 824 | - name: Test 825 | run: npm run-script test:ember --launch \${{ matrix.browser }} 826 | 827 | 828 | try-scenarios: 829 | name: Tests - \${{ matrix.ember-try-scenario }} 830 | runs-on: ubuntu-latest 831 | continue-on-error: true 832 | needs: test 833 | 834 | strategy: 835 | fail-fast: true 836 | matrix: 837 | ember-try-scenario: [ 838 | ember-lts-3.12, 839 | ember-lts-3.16, 840 | ember-release, 841 | ember-beta, 842 | ember-canary, 843 | ember-default-with-jquery, 844 | ember-classic 845 | ] 846 | 847 | steps: 848 | - uses: actions/checkout@v2 849 | with: 850 | fetch-depth: 1 851 | 852 | - uses: actions/setup-node@v2-beta 853 | with: 854 | node-version: '\${{ env.NODE_VERSION }}' 855 | 856 | - name: Get package manager's global cache path 857 | id: global-cache-dir-path 858 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 859 | 860 | - name: Cache package manager's global cache and node_modules 861 | id: cache-dependencies 862 | uses: actions/cache@v2 863 | with: 864 | path: | 865 | \${{ steps.global-cache-dir-path.outputs.dir }} 866 | node_modules 867 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 868 | hashFiles('**/package-lock.json' 869 | ) }} 870 | restore-keys: | 871 | \${{ runner.os }}-\${{ matrix.node-version }}- 872 | 873 | - name: Install Dependencies 874 | run: npm ci 875 | if: | 876 | steps.cache-dependencies.outputs.cache-hit != 'true' 877 | 878 | - name: Test 879 | env: 880 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 881 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 882 | " 883 | `; 884 | 885 | exports[`creates GitHub Actions setup migrates existing TravisCI configration supports scenario .travis.yml.ember-3.20-npm 1`] = ` 886 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 887 | # 888 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 889 | # by Create GitHub Actions setup for Ember Addons by running it again: 890 | # 891 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 892 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 893 | # 894 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 895 | # details. 896 | # 897 | # The following lines contain the configuration used in the last run. Please do 898 | # not change them. Doing so could break upgrade flow. 899 | # 900 | #$ browsers: 901 | #$ - chrome 902 | #$ emberTryScenarios: 903 | #$ - scenario: ember-lts-3.12 904 | #$ - scenario: ember-lts-3.16 905 | #$ - scenario: ember-release 906 | #$ - scenario: ember-beta 907 | #$ - scenario: ember-canary 908 | #$ - scenario: ember-default-with-jquery 909 | #$ - scenario: ember-classic 910 | #$ nodeVersion: 10.x 911 | #$ packageManager: npm 912 | # 913 | 914 | name: CI 915 | 916 | on: 917 | push: 918 | branches: 919 | - master 920 | pull_request: 921 | 922 | env: 923 | NODE_VERSION: '10.x' 924 | 925 | jobs: 926 | lint: 927 | name: Lint 928 | runs-on: ubuntu-latest 929 | steps: 930 | - uses: actions/checkout@v2 931 | with: 932 | fetch-depth: 1 933 | 934 | - uses: actions/setup-node@v2-beta 935 | with: 936 | node-version: '\${{ env.NODE_VERSION }}' 937 | 938 | - name: Get package manager's global cache path 939 | id: global-cache-dir-path 940 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 941 | 942 | - name: Cache package manager's global cache and node_modules 943 | id: cache-dependencies 944 | uses: actions/cache@v2 945 | with: 946 | path: | 947 | \${{ steps.global-cache-dir-path.outputs.dir }} 948 | node_modules 949 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 950 | hashFiles('**/package-lock.json' 951 | ) }} 952 | restore-keys: | 953 | \${{ runner.os }}-\${{ matrix.node-version }}- 954 | 955 | - name: Install Dependencies 956 | run: npm ci 957 | if: | 958 | steps.cache-dependencies.outputs.cache-hit != 'true' 959 | 960 | - name: Lint 961 | run: npm run-script lint 962 | 963 | 964 | test: 965 | name: Tests 966 | runs-on: \${{ matrix.os }} 967 | needs: lint 968 | 969 | strategy: 970 | matrix: 971 | os: [ubuntu-latest] 972 | browser: [chrome] 973 | 974 | steps: 975 | - uses: actions/checkout@v2 976 | with: 977 | fetch-depth: 1 978 | 979 | - uses: actions/setup-node@v2-beta 980 | with: 981 | node-version: '\${{ env.NODE_VERSION }}' 982 | 983 | - name: Get package manager's global cache path 984 | id: global-cache-dir-path 985 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 986 | 987 | - name: Cache package manager's global cache and node_modules 988 | id: cache-dependencies 989 | uses: actions/cache@v2 990 | with: 991 | path: | 992 | \${{ steps.global-cache-dir-path.outputs.dir }} 993 | node_modules 994 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 995 | hashFiles('**/package-lock.json' 996 | ) }} 997 | restore-keys: | 998 | \${{ runner.os }}-\${{ matrix.node-version }}- 999 | 1000 | - name: Install Dependencies 1001 | run: npm ci 1002 | if: | 1003 | steps.cache-dependencies.outputs.cache-hit != 'true' 1004 | 1005 | - name: Test 1006 | run: npm run-script test:ember --launch \${{ matrix.browser }} 1007 | 1008 | 1009 | floating-dependencies: 1010 | name: Floating Dependencies 1011 | runs-on: \${{ matrix.os }} 1012 | needs: lint 1013 | 1014 | strategy: 1015 | matrix: 1016 | os: [ubuntu-latest] 1017 | browser: [chrome] 1018 | 1019 | steps: 1020 | - uses: actions/checkout@v2 1021 | with: 1022 | fetch-depth: 1 1023 | 1024 | - uses: actions/setup-node@v2-beta 1025 | with: 1026 | node-version: '\${{ env.NODE_VERSION }}' 1027 | 1028 | - name: Get package manager's global cache path 1029 | id: global-cache-dir-path 1030 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 1031 | 1032 | - name: Cache package manager's global cache and node_modules 1033 | id: cache-dependencies 1034 | uses: actions/cache@v2 1035 | with: 1036 | path: | 1037 | \${{ steps.global-cache-dir-path.outputs.dir }} 1038 | node_modules 1039 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 1040 | restore-keys: | 1041 | \${{ runner.os }}-\${{ matrix.node-version }}- 1042 | 1043 | - name: Install Dependencies 1044 | run: npm install --no-package-lock 1045 | 1046 | - name: Test 1047 | run: npm run-script test:ember --launch \${{ matrix.browser }} 1048 | 1049 | 1050 | try-scenarios: 1051 | name: Tests - \${{ matrix.ember-try-scenario }} 1052 | runs-on: ubuntu-latest 1053 | continue-on-error: true 1054 | needs: test 1055 | 1056 | strategy: 1057 | fail-fast: true 1058 | matrix: 1059 | ember-try-scenario: [ 1060 | ember-lts-3.12, 1061 | ember-lts-3.16, 1062 | ember-release, 1063 | ember-beta, 1064 | ember-canary, 1065 | ember-default-with-jquery, 1066 | ember-classic 1067 | ] 1068 | 1069 | steps: 1070 | - uses: actions/checkout@v2 1071 | with: 1072 | fetch-depth: 1 1073 | 1074 | - uses: actions/setup-node@v2-beta 1075 | with: 1076 | node-version: '\${{ env.NODE_VERSION }}' 1077 | 1078 | - name: Get package manager's global cache path 1079 | id: global-cache-dir-path 1080 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 1081 | 1082 | - name: Cache package manager's global cache and node_modules 1083 | id: cache-dependencies 1084 | uses: actions/cache@v2 1085 | with: 1086 | path: | 1087 | \${{ steps.global-cache-dir-path.outputs.dir }} 1088 | node_modules 1089 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1090 | hashFiles('**/package-lock.json' 1091 | ) }} 1092 | restore-keys: | 1093 | \${{ runner.os }}-\${{ matrix.node-version }}- 1094 | 1095 | - name: Install Dependencies 1096 | run: npm ci 1097 | if: | 1098 | steps.cache-dependencies.outputs.cache-hit != 'true' 1099 | 1100 | - name: Test 1101 | env: 1102 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 1103 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 1104 | " 1105 | `; 1106 | 1107 | exports[`creates GitHub Actions setup migrates existing TravisCI configration supports scenario .travis.yml.ember-3.20-yarn 1`] = ` 1108 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 1109 | # 1110 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 1111 | # by Create GitHub Actions setup for Ember Addons by running it again: 1112 | # 1113 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 1114 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 1115 | # 1116 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 1117 | # details. 1118 | # 1119 | # The following lines contain the configuration used in the last run. Please do 1120 | # not change them. Doing so could break upgrade flow. 1121 | # 1122 | #$ browsers: 1123 | #$ - chrome 1124 | #$ emberTryScenarios: 1125 | #$ - scenario: ember-lts-3.12 1126 | #$ - scenario: ember-lts-3.16 1127 | #$ - scenario: ember-lts-3.20 1128 | #$ - scenario: ember-release 1129 | #$ - scenario: ember-beta 1130 | #$ - scenario: ember-canary 1131 | #$ - scenario: ember-default-with-jquery 1132 | #$ - scenario: ember-classic 1133 | #$ nodeVersion: 10.x 1134 | #$ packageManager: yarn 1135 | # 1136 | 1137 | name: CI 1138 | 1139 | on: 1140 | push: 1141 | branches: 1142 | - master 1143 | pull_request: 1144 | 1145 | env: 1146 | NODE_VERSION: '10.x' 1147 | 1148 | jobs: 1149 | lint: 1150 | name: Lint 1151 | runs-on: ubuntu-latest 1152 | steps: 1153 | - uses: actions/checkout@v2 1154 | with: 1155 | fetch-depth: 1 1156 | 1157 | - uses: actions/setup-node@v2-beta 1158 | with: 1159 | node-version: '\${{ env.NODE_VERSION }}' 1160 | 1161 | - name: Get package manager's global cache path 1162 | id: global-cache-dir-path 1163 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1164 | 1165 | - name: Cache package manager's global cache and node_modules 1166 | id: cache-dependencies 1167 | uses: actions/cache@v2 1168 | with: 1169 | path: | 1170 | \${{ steps.global-cache-dir-path.outputs.dir }} 1171 | node_modules 1172 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1173 | hashFiles('**/yarn.lock' 1174 | ) }} 1175 | restore-keys: | 1176 | \${{ runner.os }}-\${{ matrix.node-version }}- 1177 | 1178 | - name: Install Dependencies 1179 | run: yarn install --frozen-lockfile 1180 | if: | 1181 | steps.cache-dependencies.outputs.cache-hit != 'true' 1182 | 1183 | - name: Lint 1184 | run: yarn lint 1185 | 1186 | 1187 | test: 1188 | name: Tests 1189 | runs-on: \${{ matrix.os }} 1190 | needs: lint 1191 | 1192 | strategy: 1193 | matrix: 1194 | os: [ubuntu-latest] 1195 | browser: [chrome] 1196 | 1197 | steps: 1198 | - uses: actions/checkout@v2 1199 | with: 1200 | fetch-depth: 1 1201 | 1202 | - uses: actions/setup-node@v2-beta 1203 | with: 1204 | node-version: '\${{ env.NODE_VERSION }}' 1205 | 1206 | - name: Get package manager's global cache path 1207 | id: global-cache-dir-path 1208 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1209 | 1210 | - name: Cache package manager's global cache and node_modules 1211 | id: cache-dependencies 1212 | uses: actions/cache@v2 1213 | with: 1214 | path: | 1215 | \${{ steps.global-cache-dir-path.outputs.dir }} 1216 | node_modules 1217 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1218 | hashFiles('**/yarn.lock' 1219 | ) }} 1220 | restore-keys: | 1221 | \${{ runner.os }}-\${{ matrix.node-version }}- 1222 | 1223 | - name: Install Dependencies 1224 | run: yarn install --frozen-lockfile 1225 | if: | 1226 | steps.cache-dependencies.outputs.cache-hit != 'true' 1227 | 1228 | - name: Test 1229 | run: yarn test:ember --launch \${{ matrix.browser }} 1230 | 1231 | 1232 | floating-dependencies: 1233 | name: Floating Dependencies 1234 | runs-on: \${{ matrix.os }} 1235 | needs: lint 1236 | 1237 | strategy: 1238 | matrix: 1239 | os: [ubuntu-latest] 1240 | browser: [chrome] 1241 | 1242 | steps: 1243 | - uses: actions/checkout@v2 1244 | with: 1245 | fetch-depth: 1 1246 | 1247 | - uses: actions/setup-node@v2-beta 1248 | with: 1249 | node-version: '\${{ env.NODE_VERSION }}' 1250 | 1251 | - name: Get package manager's global cache path 1252 | id: global-cache-dir-path 1253 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1254 | 1255 | - name: Cache package manager's global cache and node_modules 1256 | id: cache-dependencies 1257 | uses: actions/cache@v2 1258 | with: 1259 | path: | 1260 | \${{ steps.global-cache-dir-path.outputs.dir }} 1261 | node_modules 1262 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 1263 | restore-keys: | 1264 | \${{ runner.os }}-\${{ matrix.node-version }}- 1265 | 1266 | - name: Install Dependencies 1267 | run: yarn install --no-lockfile --non-interactive 1268 | 1269 | - name: Test 1270 | run: yarn test:ember --launch \${{ matrix.browser }} 1271 | 1272 | 1273 | try-scenarios: 1274 | name: Tests - \${{ matrix.ember-try-scenario }} 1275 | runs-on: ubuntu-latest 1276 | continue-on-error: true 1277 | needs: test 1278 | 1279 | strategy: 1280 | fail-fast: true 1281 | matrix: 1282 | ember-try-scenario: [ 1283 | ember-lts-3.12, 1284 | ember-lts-3.16, 1285 | ember-lts-3.20, 1286 | ember-release, 1287 | ember-beta, 1288 | ember-canary, 1289 | ember-default-with-jquery, 1290 | ember-classic 1291 | ] 1292 | 1293 | steps: 1294 | - uses: actions/checkout@v2 1295 | with: 1296 | fetch-depth: 1 1297 | 1298 | - uses: actions/setup-node@v2-beta 1299 | with: 1300 | node-version: '\${{ env.NODE_VERSION }}' 1301 | 1302 | - name: Get package manager's global cache path 1303 | id: global-cache-dir-path 1304 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1305 | 1306 | - name: Cache package manager's global cache and node_modules 1307 | id: cache-dependencies 1308 | uses: actions/cache@v2 1309 | with: 1310 | path: | 1311 | \${{ steps.global-cache-dir-path.outputs.dir }} 1312 | node_modules 1313 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1314 | hashFiles('**/yarn.lock' 1315 | ) }} 1316 | restore-keys: | 1317 | \${{ runner.os }}-\${{ matrix.node-version }}- 1318 | 1319 | - name: Install Dependencies 1320 | run: yarn install --frozen-lockfile 1321 | if: | 1322 | steps.cache-dependencies.outputs.cache-hit != 'true' 1323 | 1324 | - name: Test 1325 | env: 1326 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 1327 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 1328 | " 1329 | `; 1330 | 1331 | exports[`creates GitHub Actions setup picks up configuration from previous run stored in GitHub Actions workflow supports scenario ci.yml.previous-run 1`] = ` 1332 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 1333 | # 1334 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 1335 | # by Create GitHub Actions setup for Ember Addons by running it again: 1336 | # 1337 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 1338 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 1339 | # 1340 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 1341 | # details. 1342 | # 1343 | # The following lines contain the configuration used in the last run. Please do 1344 | # not change them. Doing so could break upgrade flow. 1345 | # 1346 | #$ browsers: 1347 | #$ - chrome 1348 | #$ emberTryScenarios: 1349 | #$ - scenario: ember-lts-2.16 1350 | #$ allowedToFail: false 1351 | #$ - scenario: ember-lts-2.18 1352 | #$ allowedToFail: false 1353 | #$ - scenario: ember-release 1354 | #$ allowedToFail: false 1355 | #$ - scenario: ember-beta 1356 | #$ allowedToFail: false 1357 | #$ - scenario: ember-canary 1358 | #$ allowedToFail: true 1359 | #$ - scenario: ember-default-with-jquery 1360 | #$ allowedToFail: false 1361 | #$ nodeVersion: 6.x 1362 | #$ packageManager: npm 1363 | # 1364 | 1365 | name: CI 1366 | 1367 | on: 1368 | push: 1369 | branches: 1370 | - master 1371 | pull_request: 1372 | 1373 | env: 1374 | NODE_VERSION: '6.x' 1375 | 1376 | jobs: 1377 | lint: 1378 | name: Lint 1379 | runs-on: ubuntu-latest 1380 | steps: 1381 | - uses: actions/checkout@v2 1382 | with: 1383 | fetch-depth: 1 1384 | 1385 | - uses: actions/setup-node@v2-beta 1386 | with: 1387 | node-version: '\${{ env.NODE_VERSION }}' 1388 | 1389 | - name: Get package manager's global cache path 1390 | id: global-cache-dir-path 1391 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 1392 | 1393 | - name: Cache package manager's global cache and node_modules 1394 | id: cache-dependencies 1395 | uses: actions/cache@v2 1396 | with: 1397 | path: | 1398 | \${{ steps.global-cache-dir-path.outputs.dir }} 1399 | node_modules 1400 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1401 | hashFiles('**/package-lock.json' 1402 | ) }} 1403 | restore-keys: | 1404 | \${{ runner.os }}-\${{ matrix.node-version }}- 1405 | 1406 | - name: Install Dependencies 1407 | run: npm ci 1408 | if: | 1409 | steps.cache-dependencies.outputs.cache-hit != 'true' 1410 | 1411 | - name: Lint 1412 | run: npm run-script lint 1413 | 1414 | 1415 | test: 1416 | name: Tests 1417 | runs-on: \${{ matrix.os }} 1418 | needs: lint 1419 | 1420 | strategy: 1421 | matrix: 1422 | os: [ubuntu-latest] 1423 | browser: [chrome] 1424 | 1425 | steps: 1426 | - uses: actions/checkout@v2 1427 | with: 1428 | fetch-depth: 1 1429 | 1430 | - uses: actions/setup-node@v2-beta 1431 | with: 1432 | node-version: '\${{ env.NODE_VERSION }}' 1433 | 1434 | - name: Get package manager's global cache path 1435 | id: global-cache-dir-path 1436 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 1437 | 1438 | - name: Cache package manager's global cache and node_modules 1439 | id: cache-dependencies 1440 | uses: actions/cache@v2 1441 | with: 1442 | path: | 1443 | \${{ steps.global-cache-dir-path.outputs.dir }} 1444 | node_modules 1445 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1446 | hashFiles('**/package-lock.json' 1447 | ) }} 1448 | restore-keys: | 1449 | \${{ runner.os }}-\${{ matrix.node-version }}- 1450 | 1451 | - name: Install Dependencies 1452 | run: npm ci 1453 | if: | 1454 | steps.cache-dependencies.outputs.cache-hit != 'true' 1455 | 1456 | - name: Test 1457 | run: npm run-script test:ember --launch \${{ matrix.browser }} 1458 | 1459 | 1460 | floating-dependencies: 1461 | name: Floating Dependencies 1462 | runs-on: \${{ matrix.os }} 1463 | needs: lint 1464 | 1465 | strategy: 1466 | matrix: 1467 | os: [ubuntu-latest] 1468 | browser: [chrome] 1469 | 1470 | steps: 1471 | - uses: actions/checkout@v2 1472 | with: 1473 | fetch-depth: 1 1474 | 1475 | - uses: actions/setup-node@v2-beta 1476 | with: 1477 | node-version: '\${{ env.NODE_VERSION }}' 1478 | 1479 | - name: Get package manager's global cache path 1480 | id: global-cache-dir-path 1481 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 1482 | 1483 | - name: Cache package manager's global cache and node_modules 1484 | id: cache-dependencies 1485 | uses: actions/cache@v2 1486 | with: 1487 | path: | 1488 | \${{ steps.global-cache-dir-path.outputs.dir }} 1489 | node_modules 1490 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 1491 | restore-keys: | 1492 | \${{ runner.os }}-\${{ matrix.node-version }}- 1493 | 1494 | - name: Install Dependencies 1495 | run: npm install --no-package-lock 1496 | 1497 | - name: Test 1498 | run: npm run-script test:ember --launch \${{ matrix.browser }} 1499 | 1500 | 1501 | try-scenarios: 1502 | name: Tests - \${{ matrix.ember-try-scenario }} 1503 | runs-on: ubuntu-latest 1504 | continue-on-error: true 1505 | needs: test 1506 | 1507 | strategy: 1508 | fail-fast: true 1509 | matrix: 1510 | ember-try-scenario: [ 1511 | ember-lts-2.16, 1512 | ember-lts-2.18, 1513 | ember-release, 1514 | ember-beta, 1515 | ember-canary, 1516 | ember-default-with-jquery 1517 | ] 1518 | 1519 | steps: 1520 | - uses: actions/checkout@v2 1521 | with: 1522 | fetch-depth: 1 1523 | 1524 | - uses: actions/setup-node@v2-beta 1525 | with: 1526 | node-version: '\${{ env.NODE_VERSION }}' 1527 | 1528 | - name: Get package manager's global cache path 1529 | id: global-cache-dir-path 1530 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 1531 | 1532 | - name: Cache package manager's global cache and node_modules 1533 | id: cache-dependencies 1534 | uses: actions/cache@v2 1535 | with: 1536 | path: | 1537 | \${{ steps.global-cache-dir-path.outputs.dir }} 1538 | node_modules 1539 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1540 | hashFiles('**/package-lock.json' 1541 | ) }} 1542 | restore-keys: | 1543 | \${{ runner.os }}-\${{ matrix.node-version }}- 1544 | 1545 | - name: Install Dependencies 1546 | run: npm ci 1547 | if: | 1548 | steps.cache-dependencies.outputs.cache-hit != 'true' 1549 | 1550 | - name: Test 1551 | env: 1552 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 1553 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 1554 | " 1555 | `; 1556 | 1557 | exports[`creates GitHub Actions setup uses default values if no other parser matches supports scenario: ember-try-as-created-by-ember-cli-3.24 1`] = ` 1558 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 1559 | # 1560 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 1561 | # by Create GitHub Actions setup for Ember Addons by running it again: 1562 | # 1563 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 1564 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 1565 | # 1566 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 1567 | # details. 1568 | # 1569 | # The following lines contain the configuration used in the last run. Please do 1570 | # not change them. Doing so could break upgrade flow. 1571 | # 1572 | #$ browsers: 1573 | #$ - Chrome 1574 | #$ emberTryScenarios: 1575 | #$ - scenario: ember-lts-3.16 1576 | #$ - scenario: ember-lts-3.20 1577 | #$ - scenario: ember-release 1578 | #$ - scenario: ember-beta 1579 | #$ - scenario: ember-canary 1580 | #$ - scenario: ember-default-with-jquery 1581 | #$ - scenario: ember-classic 1582 | #$ nodeVersion: '10' 1583 | #$ packageManager: yarn 1584 | # 1585 | 1586 | name: CI 1587 | 1588 | on: 1589 | push: 1590 | branches: 1591 | - master 1592 | pull_request: 1593 | 1594 | env: 1595 | NODE_VERSION: '10' 1596 | 1597 | jobs: 1598 | lint: 1599 | name: Lint 1600 | runs-on: ubuntu-latest 1601 | steps: 1602 | - uses: actions/checkout@v2 1603 | with: 1604 | fetch-depth: 1 1605 | 1606 | - uses: actions/setup-node@v2-beta 1607 | with: 1608 | node-version: '\${{ env.NODE_VERSION }}' 1609 | 1610 | - name: Get package manager's global cache path 1611 | id: global-cache-dir-path 1612 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1613 | 1614 | - name: Cache package manager's global cache and node_modules 1615 | id: cache-dependencies 1616 | uses: actions/cache@v2 1617 | with: 1618 | path: | 1619 | \${{ steps.global-cache-dir-path.outputs.dir }} 1620 | node_modules 1621 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1622 | hashFiles('**/yarn.lock' 1623 | ) }} 1624 | restore-keys: | 1625 | \${{ runner.os }}-\${{ matrix.node-version }}- 1626 | 1627 | - name: Install Dependencies 1628 | run: yarn install --frozen-lockfile 1629 | if: | 1630 | steps.cache-dependencies.outputs.cache-hit != 'true' 1631 | 1632 | - name: Lint 1633 | run: yarn lint 1634 | 1635 | 1636 | test: 1637 | name: Tests 1638 | runs-on: \${{ matrix.os }} 1639 | needs: lint 1640 | 1641 | strategy: 1642 | matrix: 1643 | os: [ubuntu-latest] 1644 | browser: [Chrome] 1645 | 1646 | steps: 1647 | - uses: actions/checkout@v2 1648 | with: 1649 | fetch-depth: 1 1650 | 1651 | - uses: actions/setup-node@v2-beta 1652 | with: 1653 | node-version: '\${{ env.NODE_VERSION }}' 1654 | 1655 | - name: Get package manager's global cache path 1656 | id: global-cache-dir-path 1657 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1658 | 1659 | - name: Cache package manager's global cache and node_modules 1660 | id: cache-dependencies 1661 | uses: actions/cache@v2 1662 | with: 1663 | path: | 1664 | \${{ steps.global-cache-dir-path.outputs.dir }} 1665 | node_modules 1666 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1667 | hashFiles('**/yarn.lock' 1668 | ) }} 1669 | restore-keys: | 1670 | \${{ runner.os }}-\${{ matrix.node-version }}- 1671 | 1672 | - name: Install Dependencies 1673 | run: yarn install --frozen-lockfile 1674 | if: | 1675 | steps.cache-dependencies.outputs.cache-hit != 'true' 1676 | 1677 | - name: Test 1678 | run: yarn test:ember --launch \${{ matrix.browser }} 1679 | 1680 | 1681 | floating-dependencies: 1682 | name: Floating Dependencies 1683 | runs-on: \${{ matrix.os }} 1684 | needs: lint 1685 | 1686 | strategy: 1687 | matrix: 1688 | os: [ubuntu-latest] 1689 | browser: [Chrome] 1690 | 1691 | steps: 1692 | - uses: actions/checkout@v2 1693 | with: 1694 | fetch-depth: 1 1695 | 1696 | - uses: actions/setup-node@v2-beta 1697 | with: 1698 | node-version: '\${{ env.NODE_VERSION }}' 1699 | 1700 | - name: Get package manager's global cache path 1701 | id: global-cache-dir-path 1702 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1703 | 1704 | - name: Cache package manager's global cache and node_modules 1705 | id: cache-dependencies 1706 | uses: actions/cache@v2 1707 | with: 1708 | path: | 1709 | \${{ steps.global-cache-dir-path.outputs.dir }} 1710 | node_modules 1711 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 1712 | restore-keys: | 1713 | \${{ runner.os }}-\${{ matrix.node-version }}- 1714 | 1715 | - name: Install Dependencies 1716 | run: yarn install --no-lockfile --non-interactive 1717 | 1718 | - name: Test 1719 | run: yarn test:ember --launch \${{ matrix.browser }} 1720 | 1721 | 1722 | try-scenarios: 1723 | name: Tests - \${{ matrix.ember-try-scenario }} 1724 | runs-on: ubuntu-latest 1725 | continue-on-error: true 1726 | needs: test 1727 | 1728 | strategy: 1729 | fail-fast: true 1730 | matrix: 1731 | ember-try-scenario: [ 1732 | ember-lts-3.16, 1733 | ember-lts-3.20, 1734 | ember-release, 1735 | ember-beta, 1736 | ember-canary, 1737 | ember-default-with-jquery, 1738 | ember-classic 1739 | ] 1740 | 1741 | steps: 1742 | - uses: actions/checkout@v2 1743 | with: 1744 | fetch-depth: 1 1745 | 1746 | - uses: actions/setup-node@v2-beta 1747 | with: 1748 | node-version: '\${{ env.NODE_VERSION }}' 1749 | 1750 | - name: Get package manager's global cache path 1751 | id: global-cache-dir-path 1752 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1753 | 1754 | - name: Cache package manager's global cache and node_modules 1755 | id: cache-dependencies 1756 | uses: actions/cache@v2 1757 | with: 1758 | path: | 1759 | \${{ steps.global-cache-dir-path.outputs.dir }} 1760 | node_modules 1761 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1762 | hashFiles('**/yarn.lock' 1763 | ) }} 1764 | restore-keys: | 1765 | \${{ runner.os }}-\${{ matrix.node-version }}- 1766 | 1767 | - name: Install Dependencies 1768 | run: yarn install --frozen-lockfile 1769 | if: | 1770 | steps.cache-dependencies.outputs.cache-hit != 'true' 1771 | 1772 | - name: Test 1773 | env: 1774 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 1775 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 1776 | " 1777 | `; 1778 | 1779 | exports[`creates GitHub Actions setup uses default values if no other parser matches supports scenario: engines-node-using-or 1`] = ` 1780 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 1781 | # 1782 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 1783 | # by Create GitHub Actions setup for Ember Addons by running it again: 1784 | # 1785 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 1786 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 1787 | # 1788 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 1789 | # details. 1790 | # 1791 | # The following lines contain the configuration used in the last run. Please do 1792 | # not change them. Doing so could break upgrade flow. 1793 | # 1794 | #$ browsers: 1795 | #$ - Chrome 1796 | #$ emberTryScenarios: 1797 | #$ - scenario: ember-lts-3.12 1798 | #$ nodeVersion: '6' 1799 | #$ packageManager: yarn 1800 | # 1801 | 1802 | name: CI 1803 | 1804 | on: 1805 | push: 1806 | branches: 1807 | - master 1808 | pull_request: 1809 | 1810 | env: 1811 | NODE_VERSION: '6' 1812 | 1813 | jobs: 1814 | lint: 1815 | name: Lint 1816 | runs-on: ubuntu-latest 1817 | steps: 1818 | - uses: actions/checkout@v2 1819 | with: 1820 | fetch-depth: 1 1821 | 1822 | - uses: actions/setup-node@v2-beta 1823 | with: 1824 | node-version: '\${{ env.NODE_VERSION }}' 1825 | 1826 | - name: Get package manager's global cache path 1827 | id: global-cache-dir-path 1828 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1829 | 1830 | - name: Cache package manager's global cache and node_modules 1831 | id: cache-dependencies 1832 | uses: actions/cache@v2 1833 | with: 1834 | path: | 1835 | \${{ steps.global-cache-dir-path.outputs.dir }} 1836 | node_modules 1837 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1838 | hashFiles('**/yarn.lock' 1839 | ) }} 1840 | restore-keys: | 1841 | \${{ runner.os }}-\${{ matrix.node-version }}- 1842 | 1843 | - name: Install Dependencies 1844 | run: yarn install --frozen-lockfile 1845 | if: | 1846 | steps.cache-dependencies.outputs.cache-hit != 'true' 1847 | 1848 | - name: Lint 1849 | run: yarn lint 1850 | 1851 | 1852 | test: 1853 | name: Tests 1854 | runs-on: \${{ matrix.os }} 1855 | needs: lint 1856 | 1857 | strategy: 1858 | matrix: 1859 | os: [ubuntu-latest] 1860 | browser: [Chrome] 1861 | 1862 | steps: 1863 | - uses: actions/checkout@v2 1864 | with: 1865 | fetch-depth: 1 1866 | 1867 | - uses: actions/setup-node@v2-beta 1868 | with: 1869 | node-version: '\${{ env.NODE_VERSION }}' 1870 | 1871 | - name: Get package manager's global cache path 1872 | id: global-cache-dir-path 1873 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1874 | 1875 | - name: Cache package manager's global cache and node_modules 1876 | id: cache-dependencies 1877 | uses: actions/cache@v2 1878 | with: 1879 | path: | 1880 | \${{ steps.global-cache-dir-path.outputs.dir }} 1881 | node_modules 1882 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1883 | hashFiles('**/yarn.lock' 1884 | ) }} 1885 | restore-keys: | 1886 | \${{ runner.os }}-\${{ matrix.node-version }}- 1887 | 1888 | - name: Install Dependencies 1889 | run: yarn install --frozen-lockfile 1890 | if: | 1891 | steps.cache-dependencies.outputs.cache-hit != 'true' 1892 | 1893 | - name: Test 1894 | run: yarn test:ember --launch \${{ matrix.browser }} 1895 | 1896 | 1897 | floating-dependencies: 1898 | name: Floating Dependencies 1899 | runs-on: \${{ matrix.os }} 1900 | needs: lint 1901 | 1902 | strategy: 1903 | matrix: 1904 | os: [ubuntu-latest] 1905 | browser: [Chrome] 1906 | 1907 | steps: 1908 | - uses: actions/checkout@v2 1909 | with: 1910 | fetch-depth: 1 1911 | 1912 | - uses: actions/setup-node@v2-beta 1913 | with: 1914 | node-version: '\${{ env.NODE_VERSION }}' 1915 | 1916 | - name: Get package manager's global cache path 1917 | id: global-cache-dir-path 1918 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1919 | 1920 | - name: Cache package manager's global cache and node_modules 1921 | id: cache-dependencies 1922 | uses: actions/cache@v2 1923 | with: 1924 | path: | 1925 | \${{ steps.global-cache-dir-path.outputs.dir }} 1926 | node_modules 1927 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 1928 | restore-keys: | 1929 | \${{ runner.os }}-\${{ matrix.node-version }}- 1930 | 1931 | - name: Install Dependencies 1932 | run: yarn install --no-lockfile --non-interactive 1933 | 1934 | - name: Test 1935 | run: yarn test:ember --launch \${{ matrix.browser }} 1936 | 1937 | 1938 | try-scenarios: 1939 | name: Tests - \${{ matrix.ember-try-scenario }} 1940 | runs-on: ubuntu-latest 1941 | continue-on-error: true 1942 | needs: test 1943 | 1944 | strategy: 1945 | fail-fast: true 1946 | matrix: 1947 | ember-try-scenario: [ 1948 | ember-lts-3.12 1949 | ] 1950 | 1951 | steps: 1952 | - uses: actions/checkout@v2 1953 | with: 1954 | fetch-depth: 1 1955 | 1956 | - uses: actions/setup-node@v2-beta 1957 | with: 1958 | node-version: '\${{ env.NODE_VERSION }}' 1959 | 1960 | - name: Get package manager's global cache path 1961 | id: global-cache-dir-path 1962 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 1963 | 1964 | - name: Cache package manager's global cache and node_modules 1965 | id: cache-dependencies 1966 | uses: actions/cache@v2 1967 | with: 1968 | path: | 1969 | \${{ steps.global-cache-dir-path.outputs.dir }} 1970 | node_modules 1971 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 1972 | hashFiles('**/yarn.lock' 1973 | ) }} 1974 | restore-keys: | 1975 | \${{ runner.os }}-\${{ matrix.node-version }}- 1976 | 1977 | - name: Install Dependencies 1978 | run: yarn install --frozen-lockfile 1979 | if: | 1980 | steps.cache-dependencies.outputs.cache-hit != 'true' 1981 | 1982 | - name: Test 1983 | env: 1984 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 1985 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 1986 | " 1987 | `; 1988 | 1989 | exports[`creates GitHub Actions setup uses default values if no other parser matches supports scenario: npm 1`] = ` 1990 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 1991 | # 1992 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 1993 | # by Create GitHub Actions setup for Ember Addons by running it again: 1994 | # 1995 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 1996 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 1997 | # 1998 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 1999 | # details. 2000 | # 2001 | # The following lines contain the configuration used in the last run. Please do 2002 | # not change them. Doing so could break upgrade flow. 2003 | # 2004 | #$ browsers: 2005 | #$ - Chrome 2006 | #$ emberTryScenarios: 2007 | #$ - scenario: ember-lts-3.12 2008 | #$ nodeVersion: '10' 2009 | #$ packageManager: npm 2010 | # 2011 | 2012 | name: CI 2013 | 2014 | on: 2015 | push: 2016 | branches: 2017 | - master 2018 | pull_request: 2019 | 2020 | env: 2021 | NODE_VERSION: '10' 2022 | 2023 | jobs: 2024 | lint: 2025 | name: Lint 2026 | runs-on: ubuntu-latest 2027 | steps: 2028 | - uses: actions/checkout@v2 2029 | with: 2030 | fetch-depth: 1 2031 | 2032 | - uses: actions/setup-node@v2-beta 2033 | with: 2034 | node-version: '\${{ env.NODE_VERSION }}' 2035 | 2036 | - name: Get package manager's global cache path 2037 | id: global-cache-dir-path 2038 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 2039 | 2040 | - name: Cache package manager's global cache and node_modules 2041 | id: cache-dependencies 2042 | uses: actions/cache@v2 2043 | with: 2044 | path: | 2045 | \${{ steps.global-cache-dir-path.outputs.dir }} 2046 | node_modules 2047 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2048 | hashFiles('**/package-lock.json' 2049 | ) }} 2050 | restore-keys: | 2051 | \${{ runner.os }}-\${{ matrix.node-version }}- 2052 | 2053 | - name: Install Dependencies 2054 | run: npm ci 2055 | if: | 2056 | steps.cache-dependencies.outputs.cache-hit != 'true' 2057 | 2058 | - name: Lint 2059 | run: npm run-script lint 2060 | 2061 | 2062 | test: 2063 | name: Tests 2064 | runs-on: \${{ matrix.os }} 2065 | needs: lint 2066 | 2067 | strategy: 2068 | matrix: 2069 | os: [ubuntu-latest] 2070 | browser: [Chrome] 2071 | 2072 | steps: 2073 | - uses: actions/checkout@v2 2074 | with: 2075 | fetch-depth: 1 2076 | 2077 | - uses: actions/setup-node@v2-beta 2078 | with: 2079 | node-version: '\${{ env.NODE_VERSION }}' 2080 | 2081 | - name: Get package manager's global cache path 2082 | id: global-cache-dir-path 2083 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 2084 | 2085 | - name: Cache package manager's global cache and node_modules 2086 | id: cache-dependencies 2087 | uses: actions/cache@v2 2088 | with: 2089 | path: | 2090 | \${{ steps.global-cache-dir-path.outputs.dir }} 2091 | node_modules 2092 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2093 | hashFiles('**/package-lock.json' 2094 | ) }} 2095 | restore-keys: | 2096 | \${{ runner.os }}-\${{ matrix.node-version }}- 2097 | 2098 | - name: Install Dependencies 2099 | run: npm ci 2100 | if: | 2101 | steps.cache-dependencies.outputs.cache-hit != 'true' 2102 | 2103 | - name: Test 2104 | run: npm run-script test:ember --launch \${{ matrix.browser }} 2105 | 2106 | 2107 | floating-dependencies: 2108 | name: Floating Dependencies 2109 | runs-on: \${{ matrix.os }} 2110 | needs: lint 2111 | 2112 | strategy: 2113 | matrix: 2114 | os: [ubuntu-latest] 2115 | browser: [Chrome] 2116 | 2117 | steps: 2118 | - uses: actions/checkout@v2 2119 | with: 2120 | fetch-depth: 1 2121 | 2122 | - uses: actions/setup-node@v2-beta 2123 | with: 2124 | node-version: '\${{ env.NODE_VERSION }}' 2125 | 2126 | - name: Get package manager's global cache path 2127 | id: global-cache-dir-path 2128 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 2129 | 2130 | - name: Cache package manager's global cache and node_modules 2131 | id: cache-dependencies 2132 | uses: actions/cache@v2 2133 | with: 2134 | path: | 2135 | \${{ steps.global-cache-dir-path.outputs.dir }} 2136 | node_modules 2137 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 2138 | restore-keys: | 2139 | \${{ runner.os }}-\${{ matrix.node-version }}- 2140 | 2141 | - name: Install Dependencies 2142 | run: npm install --no-package-lock 2143 | 2144 | - name: Test 2145 | run: npm run-script test:ember --launch \${{ matrix.browser }} 2146 | 2147 | 2148 | try-scenarios: 2149 | name: Tests - \${{ matrix.ember-try-scenario }} 2150 | runs-on: ubuntu-latest 2151 | continue-on-error: true 2152 | needs: test 2153 | 2154 | strategy: 2155 | fail-fast: true 2156 | matrix: 2157 | ember-try-scenario: [ 2158 | ember-lts-3.12 2159 | ] 2160 | 2161 | steps: 2162 | - uses: actions/checkout@v2 2163 | with: 2164 | fetch-depth: 1 2165 | 2166 | - uses: actions/setup-node@v2-beta 2167 | with: 2168 | node-version: '\${{ env.NODE_VERSION }}' 2169 | 2170 | - name: Get package manager's global cache path 2171 | id: global-cache-dir-path 2172 | run: echo \\"::set-output name=dir::$(npm config get cache)\\" 2173 | 2174 | - name: Cache package manager's global cache and node_modules 2175 | id: cache-dependencies 2176 | uses: actions/cache@v2 2177 | with: 2178 | path: | 2179 | \${{ steps.global-cache-dir-path.outputs.dir }} 2180 | node_modules 2181 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2182 | hashFiles('**/package-lock.json' 2183 | ) }} 2184 | restore-keys: | 2185 | \${{ runner.os }}-\${{ matrix.node-version }}- 2186 | 2187 | - name: Install Dependencies 2188 | run: npm ci 2189 | if: | 2190 | steps.cache-dependencies.outputs.cache-hit != 'true' 2191 | 2192 | - name: Test 2193 | env: 2194 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 2195 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 2196 | " 2197 | `; 2198 | 2199 | exports[`creates GitHub Actions setup uses default values if no other parser matches supports scenario: testem-config-generated-by-ember-cli-3.20 1`] = ` 2200 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 2201 | # 2202 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 2203 | # by Create GitHub Actions setup for Ember Addons by running it again: 2204 | # 2205 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 2206 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 2207 | # 2208 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 2209 | # details. 2210 | # 2211 | # The following lines contain the configuration used in the last run. Please do 2212 | # not change them. Doing so could break upgrade flow. 2213 | # 2214 | #$ browsers: 2215 | #$ - Chrome 2216 | #$ emberTryScenarios: 2217 | #$ - scenario: ember-lts-3.12 2218 | #$ nodeVersion: '6' 2219 | #$ packageManager: yarn 2220 | # 2221 | 2222 | name: CI 2223 | 2224 | on: 2225 | push: 2226 | branches: 2227 | - master 2228 | pull_request: 2229 | 2230 | env: 2231 | NODE_VERSION: '6' 2232 | 2233 | jobs: 2234 | lint: 2235 | name: Lint 2236 | runs-on: ubuntu-latest 2237 | steps: 2238 | - uses: actions/checkout@v2 2239 | with: 2240 | fetch-depth: 1 2241 | 2242 | - uses: actions/setup-node@v2-beta 2243 | with: 2244 | node-version: '\${{ env.NODE_VERSION }}' 2245 | 2246 | - name: Get package manager's global cache path 2247 | id: global-cache-dir-path 2248 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2249 | 2250 | - name: Cache package manager's global cache and node_modules 2251 | id: cache-dependencies 2252 | uses: actions/cache@v2 2253 | with: 2254 | path: | 2255 | \${{ steps.global-cache-dir-path.outputs.dir }} 2256 | node_modules 2257 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2258 | hashFiles('**/yarn.lock' 2259 | ) }} 2260 | restore-keys: | 2261 | \${{ runner.os }}-\${{ matrix.node-version }}- 2262 | 2263 | - name: Install Dependencies 2264 | run: yarn install --frozen-lockfile 2265 | if: | 2266 | steps.cache-dependencies.outputs.cache-hit != 'true' 2267 | 2268 | - name: Lint 2269 | run: yarn lint 2270 | 2271 | 2272 | test: 2273 | name: Tests 2274 | runs-on: \${{ matrix.os }} 2275 | needs: lint 2276 | 2277 | strategy: 2278 | matrix: 2279 | os: [ubuntu-latest] 2280 | browser: [Chrome] 2281 | 2282 | steps: 2283 | - uses: actions/checkout@v2 2284 | with: 2285 | fetch-depth: 1 2286 | 2287 | - uses: actions/setup-node@v2-beta 2288 | with: 2289 | node-version: '\${{ env.NODE_VERSION }}' 2290 | 2291 | - name: Get package manager's global cache path 2292 | id: global-cache-dir-path 2293 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2294 | 2295 | - name: Cache package manager's global cache and node_modules 2296 | id: cache-dependencies 2297 | uses: actions/cache@v2 2298 | with: 2299 | path: | 2300 | \${{ steps.global-cache-dir-path.outputs.dir }} 2301 | node_modules 2302 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2303 | hashFiles('**/yarn.lock' 2304 | ) }} 2305 | restore-keys: | 2306 | \${{ runner.os }}-\${{ matrix.node-version }}- 2307 | 2308 | - name: Install Dependencies 2309 | run: yarn install --frozen-lockfile 2310 | if: | 2311 | steps.cache-dependencies.outputs.cache-hit != 'true' 2312 | 2313 | - name: Test 2314 | run: yarn test:ember --launch \${{ matrix.browser }} 2315 | 2316 | 2317 | floating-dependencies: 2318 | name: Floating Dependencies 2319 | runs-on: \${{ matrix.os }} 2320 | needs: lint 2321 | 2322 | strategy: 2323 | matrix: 2324 | os: [ubuntu-latest] 2325 | browser: [Chrome] 2326 | 2327 | steps: 2328 | - uses: actions/checkout@v2 2329 | with: 2330 | fetch-depth: 1 2331 | 2332 | - uses: actions/setup-node@v2-beta 2333 | with: 2334 | node-version: '\${{ env.NODE_VERSION }}' 2335 | 2336 | - name: Get package manager's global cache path 2337 | id: global-cache-dir-path 2338 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2339 | 2340 | - name: Cache package manager's global cache and node_modules 2341 | id: cache-dependencies 2342 | uses: actions/cache@v2 2343 | with: 2344 | path: | 2345 | \${{ steps.global-cache-dir-path.outputs.dir }} 2346 | node_modules 2347 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 2348 | restore-keys: | 2349 | \${{ runner.os }}-\${{ matrix.node-version }}- 2350 | 2351 | - name: Install Dependencies 2352 | run: yarn install --no-lockfile --non-interactive 2353 | 2354 | - name: Test 2355 | run: yarn test:ember --launch \${{ matrix.browser }} 2356 | 2357 | 2358 | try-scenarios: 2359 | name: Tests - \${{ matrix.ember-try-scenario }} 2360 | runs-on: ubuntu-latest 2361 | continue-on-error: true 2362 | needs: test 2363 | 2364 | strategy: 2365 | fail-fast: true 2366 | matrix: 2367 | ember-try-scenario: [ 2368 | ember-lts-3.12 2369 | ] 2370 | 2371 | steps: 2372 | - uses: actions/checkout@v2 2373 | with: 2374 | fetch-depth: 1 2375 | 2376 | - uses: actions/setup-node@v2-beta 2377 | with: 2378 | node-version: '\${{ env.NODE_VERSION }}' 2379 | 2380 | - name: Get package manager's global cache path 2381 | id: global-cache-dir-path 2382 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2383 | 2384 | - name: Cache package manager's global cache and node_modules 2385 | id: cache-dependencies 2386 | uses: actions/cache@v2 2387 | with: 2388 | path: | 2389 | \${{ steps.global-cache-dir-path.outputs.dir }} 2390 | node_modules 2391 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2392 | hashFiles('**/yarn.lock' 2393 | ) }} 2394 | restore-keys: | 2395 | \${{ runner.os }}-\${{ matrix.node-version }}- 2396 | 2397 | - name: Install Dependencies 2398 | run: yarn install --frozen-lockfile 2399 | if: | 2400 | steps.cache-dependencies.outputs.cache-hit != 'true' 2401 | 2402 | - name: Test 2403 | env: 2404 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 2405 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 2406 | " 2407 | `; 2408 | 2409 | exports[`creates GitHub Actions setup uses default values if no other parser matches supports scenario: testem-config-including-firefox 1`] = ` 2410 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 2411 | # 2412 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 2413 | # by Create GitHub Actions setup for Ember Addons by running it again: 2414 | # 2415 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 2416 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 2417 | # 2418 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 2419 | # details. 2420 | # 2421 | # The following lines contain the configuration used in the last run. Please do 2422 | # not change them. Doing so could break upgrade flow. 2423 | # 2424 | #$ browsers: 2425 | #$ - Chrome 2426 | #$ - Firefox 2427 | #$ emberTryScenarios: 2428 | #$ - scenario: ember-lts-3.12 2429 | #$ nodeVersion: '6' 2430 | #$ packageManager: yarn 2431 | # 2432 | 2433 | name: CI 2434 | 2435 | on: 2436 | push: 2437 | branches: 2438 | - master 2439 | pull_request: 2440 | 2441 | env: 2442 | NODE_VERSION: '6' 2443 | 2444 | jobs: 2445 | lint: 2446 | name: Lint 2447 | runs-on: ubuntu-latest 2448 | steps: 2449 | - uses: actions/checkout@v2 2450 | with: 2451 | fetch-depth: 1 2452 | 2453 | - uses: actions/setup-node@v2-beta 2454 | with: 2455 | node-version: '\${{ env.NODE_VERSION }}' 2456 | 2457 | - name: Get package manager's global cache path 2458 | id: global-cache-dir-path 2459 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2460 | 2461 | - name: Cache package manager's global cache and node_modules 2462 | id: cache-dependencies 2463 | uses: actions/cache@v2 2464 | with: 2465 | path: | 2466 | \${{ steps.global-cache-dir-path.outputs.dir }} 2467 | node_modules 2468 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2469 | hashFiles('**/yarn.lock' 2470 | ) }} 2471 | restore-keys: | 2472 | \${{ runner.os }}-\${{ matrix.node-version }}- 2473 | 2474 | - name: Install Dependencies 2475 | run: yarn install --frozen-lockfile 2476 | if: | 2477 | steps.cache-dependencies.outputs.cache-hit != 'true' 2478 | 2479 | - name: Lint 2480 | run: yarn lint 2481 | 2482 | 2483 | test: 2484 | name: Tests 2485 | runs-on: \${{ matrix.os }} 2486 | needs: lint 2487 | 2488 | strategy: 2489 | matrix: 2490 | os: [ubuntu-latest] 2491 | browser: [Chrome, Firefox] 2492 | 2493 | steps: 2494 | - uses: actions/checkout@v2 2495 | with: 2496 | fetch-depth: 1 2497 | 2498 | - uses: actions/setup-node@v2-beta 2499 | with: 2500 | node-version: '\${{ env.NODE_VERSION }}' 2501 | 2502 | - name: Get package manager's global cache path 2503 | id: global-cache-dir-path 2504 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2505 | 2506 | - name: Cache package manager's global cache and node_modules 2507 | id: cache-dependencies 2508 | uses: actions/cache@v2 2509 | with: 2510 | path: | 2511 | \${{ steps.global-cache-dir-path.outputs.dir }} 2512 | node_modules 2513 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2514 | hashFiles('**/yarn.lock' 2515 | ) }} 2516 | restore-keys: | 2517 | \${{ runner.os }}-\${{ matrix.node-version }}- 2518 | 2519 | - name: Install Dependencies 2520 | run: yarn install --frozen-lockfile 2521 | if: | 2522 | steps.cache-dependencies.outputs.cache-hit != 'true' 2523 | 2524 | - name: Test 2525 | run: yarn test:ember --launch \${{ matrix.browser }} 2526 | 2527 | 2528 | floating-dependencies: 2529 | name: Floating Dependencies 2530 | runs-on: \${{ matrix.os }} 2531 | needs: lint 2532 | 2533 | strategy: 2534 | matrix: 2535 | os: [ubuntu-latest] 2536 | browser: [Chrome, Firefox] 2537 | 2538 | steps: 2539 | - uses: actions/checkout@v2 2540 | with: 2541 | fetch-depth: 1 2542 | 2543 | - uses: actions/setup-node@v2-beta 2544 | with: 2545 | node-version: '\${{ env.NODE_VERSION }}' 2546 | 2547 | - name: Get package manager's global cache path 2548 | id: global-cache-dir-path 2549 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2550 | 2551 | - name: Cache package manager's global cache and node_modules 2552 | id: cache-dependencies 2553 | uses: actions/cache@v2 2554 | with: 2555 | path: | 2556 | \${{ steps.global-cache-dir-path.outputs.dir }} 2557 | node_modules 2558 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 2559 | restore-keys: | 2560 | \${{ runner.os }}-\${{ matrix.node-version }}- 2561 | 2562 | - name: Install Dependencies 2563 | run: yarn install --no-lockfile --non-interactive 2564 | 2565 | - name: Test 2566 | run: yarn test:ember --launch \${{ matrix.browser }} 2567 | 2568 | 2569 | try-scenarios: 2570 | name: Tests - \${{ matrix.ember-try-scenario }} 2571 | runs-on: ubuntu-latest 2572 | continue-on-error: true 2573 | needs: test 2574 | 2575 | strategy: 2576 | fail-fast: true 2577 | matrix: 2578 | ember-try-scenario: [ 2579 | ember-lts-3.12 2580 | ] 2581 | 2582 | steps: 2583 | - uses: actions/checkout@v2 2584 | with: 2585 | fetch-depth: 1 2586 | 2587 | - uses: actions/setup-node@v2-beta 2588 | with: 2589 | node-version: '\${{ env.NODE_VERSION }}' 2590 | 2591 | - name: Get package manager's global cache path 2592 | id: global-cache-dir-path 2593 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2594 | 2595 | - name: Cache package manager's global cache and node_modules 2596 | id: cache-dependencies 2597 | uses: actions/cache@v2 2598 | with: 2599 | path: | 2600 | \${{ steps.global-cache-dir-path.outputs.dir }} 2601 | node_modules 2602 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2603 | hashFiles('**/yarn.lock' 2604 | ) }} 2605 | restore-keys: | 2606 | \${{ runner.os }}-\${{ matrix.node-version }}- 2607 | 2608 | - name: Install Dependencies 2609 | run: yarn install --frozen-lockfile 2610 | if: | 2611 | steps.cache-dependencies.outputs.cache-hit != 'true' 2612 | 2613 | - name: Test 2614 | env: 2615 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 2616 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 2617 | " 2618 | `; 2619 | 2620 | exports[`creates GitHub Actions setup uses default values if no other parser matches supports scenario: yarn 1`] = ` 2621 | "# This file was autogenerated by create-github-actions-setup-for-ember-addon. 2622 | # 2623 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 2624 | # by Create GitHub Actions setup for Ember Addons by running it again: 2625 | # 2626 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 2627 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 2628 | # 2629 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 2630 | # details. 2631 | # 2632 | # The following lines contain the configuration used in the last run. Please do 2633 | # not change them. Doing so could break upgrade flow. 2634 | # 2635 | #$ browsers: 2636 | #$ - Chrome 2637 | #$ emberTryScenarios: 2638 | #$ - scenario: ember-lts-3.12 2639 | #$ nodeVersion: '10' 2640 | #$ packageManager: yarn 2641 | # 2642 | 2643 | name: CI 2644 | 2645 | on: 2646 | push: 2647 | branches: 2648 | - master 2649 | pull_request: 2650 | 2651 | env: 2652 | NODE_VERSION: '10' 2653 | 2654 | jobs: 2655 | lint: 2656 | name: Lint 2657 | runs-on: ubuntu-latest 2658 | steps: 2659 | - uses: actions/checkout@v2 2660 | with: 2661 | fetch-depth: 1 2662 | 2663 | - uses: actions/setup-node@v2-beta 2664 | with: 2665 | node-version: '\${{ env.NODE_VERSION }}' 2666 | 2667 | - name: Get package manager's global cache path 2668 | id: global-cache-dir-path 2669 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2670 | 2671 | - name: Cache package manager's global cache and node_modules 2672 | id: cache-dependencies 2673 | uses: actions/cache@v2 2674 | with: 2675 | path: | 2676 | \${{ steps.global-cache-dir-path.outputs.dir }} 2677 | node_modules 2678 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2679 | hashFiles('**/yarn.lock' 2680 | ) }} 2681 | restore-keys: | 2682 | \${{ runner.os }}-\${{ matrix.node-version }}- 2683 | 2684 | - name: Install Dependencies 2685 | run: yarn install --frozen-lockfile 2686 | if: | 2687 | steps.cache-dependencies.outputs.cache-hit != 'true' 2688 | 2689 | - name: Lint 2690 | run: yarn lint 2691 | 2692 | 2693 | test: 2694 | name: Tests 2695 | runs-on: \${{ matrix.os }} 2696 | needs: lint 2697 | 2698 | strategy: 2699 | matrix: 2700 | os: [ubuntu-latest] 2701 | browser: [Chrome] 2702 | 2703 | steps: 2704 | - uses: actions/checkout@v2 2705 | with: 2706 | fetch-depth: 1 2707 | 2708 | - uses: actions/setup-node@v2-beta 2709 | with: 2710 | node-version: '\${{ env.NODE_VERSION }}' 2711 | 2712 | - name: Get package manager's global cache path 2713 | id: global-cache-dir-path 2714 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2715 | 2716 | - name: Cache package manager's global cache and node_modules 2717 | id: cache-dependencies 2718 | uses: actions/cache@v2 2719 | with: 2720 | path: | 2721 | \${{ steps.global-cache-dir-path.outputs.dir }} 2722 | node_modules 2723 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2724 | hashFiles('**/yarn.lock' 2725 | ) }} 2726 | restore-keys: | 2727 | \${{ runner.os }}-\${{ matrix.node-version }}- 2728 | 2729 | - name: Install Dependencies 2730 | run: yarn install --frozen-lockfile 2731 | if: | 2732 | steps.cache-dependencies.outputs.cache-hit != 'true' 2733 | 2734 | - name: Test 2735 | run: yarn test:ember --launch \${{ matrix.browser }} 2736 | 2737 | 2738 | floating-dependencies: 2739 | name: Floating Dependencies 2740 | runs-on: \${{ matrix.os }} 2741 | needs: lint 2742 | 2743 | strategy: 2744 | matrix: 2745 | os: [ubuntu-latest] 2746 | browser: [Chrome] 2747 | 2748 | steps: 2749 | - uses: actions/checkout@v2 2750 | with: 2751 | fetch-depth: 1 2752 | 2753 | - uses: actions/setup-node@v2-beta 2754 | with: 2755 | node-version: '\${{ env.NODE_VERSION }}' 2756 | 2757 | - name: Get package manager's global cache path 2758 | id: global-cache-dir-path 2759 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2760 | 2761 | - name: Cache package manager's global cache and node_modules 2762 | id: cache-dependencies 2763 | uses: actions/cache@v2 2764 | with: 2765 | path: | 2766 | \${{ steps.global-cache-dir-path.outputs.dir }} 2767 | node_modules 2768 | key: \${{ runner.os }}-\${{ matrix.node-version }}-floating-deps 2769 | restore-keys: | 2770 | \${{ runner.os }}-\${{ matrix.node-version }}- 2771 | 2772 | - name: Install Dependencies 2773 | run: yarn install --no-lockfile --non-interactive 2774 | 2775 | - name: Test 2776 | run: yarn test:ember --launch \${{ matrix.browser }} 2777 | 2778 | 2779 | try-scenarios: 2780 | name: Tests - \${{ matrix.ember-try-scenario }} 2781 | runs-on: ubuntu-latest 2782 | continue-on-error: true 2783 | needs: test 2784 | 2785 | strategy: 2786 | fail-fast: true 2787 | matrix: 2788 | ember-try-scenario: [ 2789 | ember-lts-3.12 2790 | ] 2791 | 2792 | steps: 2793 | - uses: actions/checkout@v2 2794 | with: 2795 | fetch-depth: 1 2796 | 2797 | - uses: actions/setup-node@v2-beta 2798 | with: 2799 | node-version: '\${{ env.NODE_VERSION }}' 2800 | 2801 | - name: Get package manager's global cache path 2802 | id: global-cache-dir-path 2803 | run: echo \\"::set-output name=dir::$(yarn cache dir)\\" 2804 | 2805 | - name: Cache package manager's global cache and node_modules 2806 | id: cache-dependencies 2807 | uses: actions/cache@v2 2808 | with: 2809 | path: | 2810 | \${{ steps.global-cache-dir-path.outputs.dir }} 2811 | node_modules 2812 | key: \${{ runner.os }}-\${{ matrix.node-version }}-\${{ 2813 | hashFiles('**/yarn.lock' 2814 | ) }} 2815 | restore-keys: | 2816 | \${{ runner.os }}-\${{ matrix.node-version }}- 2817 | 2818 | - name: Install Dependencies 2819 | run: yarn install --frozen-lockfile 2820 | if: | 2821 | steps.cache-dependencies.outputs.cache-hit != 'true' 2822 | 2823 | - name: Test 2824 | env: 2825 | EMBER_TRY_SCENARIO: \${{ matrix.ember-try-scenario }} 2826 | run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 2827 | " 2828 | `; 2829 | -------------------------------------------------------------------------------- /tests/acceptance/creates-github-actions.test.ts: -------------------------------------------------------------------------------- 1 | import execa from 'execa'; 2 | import fs from 'fs'; 3 | import { promises as fsPromises } from 'fs'; 4 | import os from 'os'; 5 | import path from 'path'; 6 | import { prepareFixtures } from '../utils/fixtures'; 7 | 8 | // import directly from fs/promises when dropping node 12 support 9 | const { mkdtemp, readFile, rmdir } = fsPromises; 10 | 11 | const executable = path.join( 12 | __dirname, 13 | '..', 14 | '..', 15 | 'bin', 16 | 'create-github-actions-setup-for-ember-addon' 17 | ); 18 | 19 | let tmpDirForTesting: string; 20 | 21 | beforeEach(async () => { 22 | tmpDirForTesting = await mkdtemp( 23 | path.join(os.tmpdir(), 'create-github-actions-setup-for-ember-addon-tests-') 24 | ); 25 | }); 26 | afterEach(async () => { 27 | await rmdir(tmpDirForTesting, { recursive: true }); 28 | }); 29 | 30 | describe('creates GitHub Actions setup', () => { 31 | describe('uses default values if no other parser matches', () => { 32 | const fixturesPath = path.join(__dirname, '..', 'fixtures', 'defaults'); 33 | const scenarios = fs.readdirSync(fixturesPath); 34 | 35 | scenarios.forEach((scenario) => { 36 | it(`supports scenario: ${scenario}`, async () => { 37 | await prepareFixtures( 38 | path.join('defaults', scenario), 39 | tmpDirForTesting 40 | ); 41 | 42 | await execa(executable, [], { 43 | cwd: tmpDirForTesting, 44 | }); 45 | 46 | expect( 47 | await readFile( 48 | path.join(tmpDirForTesting, '.github', 'workflows', 'ci.yml'), 49 | { encoding: 'utf-8' } 50 | ) 51 | ).toMatchSnapshot(); 52 | }); 53 | }); 54 | }); 55 | 56 | describe('picks up configuration from previous run stored in GitHub Actions workflow', () => { 57 | const fixturesPath = path.join( 58 | __dirname, 59 | '..', 60 | 'fixtures', 61 | 'github-actions' 62 | ); 63 | const scenarios = fs.readdirSync(fixturesPath); 64 | 65 | scenarios.forEach((scenario) => { 66 | it(`supports scenario ci.yml.${scenario}`, async () => { 67 | await prepareFixtures( 68 | path.join('github-actions', scenario), 69 | tmpDirForTesting 70 | ); 71 | 72 | await execa(executable, [], { 73 | cwd: tmpDirForTesting, 74 | }); 75 | 76 | expect( 77 | await readFile( 78 | path.join(tmpDirForTesting, '.github', 'workflows', 'ci.yml'), 79 | { encoding: 'utf-8' } 80 | ) 81 | ).toMatchSnapshot(); 82 | }); 83 | }); 84 | }); 85 | 86 | describe('migrates existing TravisCI configration', () => { 87 | const fixturesPath = path.join(__dirname, '..', 'fixtures', 'travis-ci'); 88 | const scenarios = fs.readdirSync(fixturesPath); 89 | 90 | scenarios.forEach((scenario) => { 91 | it(`supports scenario .travis.yml.${scenario}`, async () => { 92 | await prepareFixtures( 93 | path.join('travis-ci', scenario), 94 | tmpDirForTesting 95 | ); 96 | 97 | await execa(executable, [], { 98 | cwd: tmpDirForTesting, 99 | }); 100 | 101 | expect( 102 | await readFile( 103 | path.join(tmpDirForTesting, '.github', 'workflows', 'ci.yml'), 104 | { encoding: 'utf-8' } 105 | ) 106 | ).toMatchSnapshot(); 107 | }); 108 | }); 109 | }); 110 | }); 111 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/ember-try-as-created-by-ember-cli-3.24/config/ember-try.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const getChannelURL = require('ember-source-channel-url'); 4 | 5 | module.exports = async function () { 6 | return { 7 | scenarios: [ 8 | { 9 | name: 'ember-lts-3.16', 10 | npm: { 11 | devDependencies: { 12 | 'ember-source': '~3.16.0', 13 | }, 14 | }, 15 | }, 16 | { 17 | name: 'ember-lts-3.20', 18 | npm: { 19 | devDependencies: { 20 | 'ember-source': '~3.20.5', 21 | }, 22 | }, 23 | }, 24 | { 25 | name: 'ember-release', 26 | npm: { 27 | devDependencies: { 28 | 'ember-source': await getChannelURL('release'), 29 | }, 30 | }, 31 | }, 32 | { 33 | name: 'ember-beta', 34 | npm: { 35 | devDependencies: { 36 | 'ember-source': await getChannelURL('beta'), 37 | }, 38 | }, 39 | }, 40 | { 41 | name: 'ember-canary', 42 | npm: { 43 | devDependencies: { 44 | 'ember-source': await getChannelURL('canary'), 45 | }, 46 | }, 47 | }, 48 | { 49 | name: 'ember-default-with-jquery', 50 | env: { 51 | EMBER_OPTIONAL_FEATURES: JSON.stringify({ 52 | 'jquery-integration': true, 53 | }), 54 | }, 55 | npm: { 56 | devDependencies: { 57 | '@ember/jquery': '^1.1.0', 58 | }, 59 | }, 60 | }, 61 | { 62 | name: 'ember-classic', 63 | env: { 64 | EMBER_OPTIONAL_FEATURES: JSON.stringify({ 65 | 'application-template-wrapper': true, 66 | 'default-async-observers': false, 67 | 'template-only-glimmer-components': false, 68 | }), 69 | }, 70 | npm: { 71 | ember: { 72 | edition: 'classic', 73 | }, 74 | }, 75 | }, 76 | ], 77 | }; 78 | }; 79 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/ember-try-as-created-by-ember-cli-3.24/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "ember-source-channel-url": "^3.0.0" 4 | }, 5 | "engines": { 6 | "node": ">=10" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/ember-try-as-created-by-ember-cli-3.24/testem.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | launch_in_ci: ['Chrome'], 3 | }; 4 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/ember-try-as-created-by-ember-cli-3.24/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | ember-source-channel-url@^3.0.0: 6 | version "3.0.0" 7 | resolved "https://registry.yarnpkg.com/ember-source-channel-url/-/ember-source-channel-url-3.0.0.tgz#bcd5be72c63fa0b8c390b3121783b462063e2a1b" 8 | integrity sha512-vF/8BraOc66ZxIDo3VuNP7iiDrnXEINclJgSJmqwAAEpg84Zb1DHPI22XTXSDA+E8fW5btPUxu65c3ZXi8AQFA== 9 | dependencies: 10 | node-fetch "^2.6.0" 11 | 12 | node-fetch@^2.6.0: 13 | version "2.6.1" 14 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" 15 | integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== 16 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/engines-node-using-or/config/ember-try.js: -------------------------------------------------------------------------------- 1 | module.exports = async function () { 2 | return { 3 | scenarios: [ 4 | { 5 | name: 'ember-lts-3.12', 6 | }, 7 | ], 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/engines-node-using-or/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "engines": { 3 | "node": "6.* || 8.* || >= 10.*" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/engines-node-using-or/testem.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | launch_in_ci: ['Chrome'], 3 | }; 4 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/engines-node-using-or/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jelhan/create-github-actions-setup-for-ember-addon/cdc8b63ce278fa0ff02a3516ee71d7887982f383/tests/fixtures/defaults/engines-node-using-or/yarn.lock -------------------------------------------------------------------------------- /tests/fixtures/defaults/npm/config/ember-try.js: -------------------------------------------------------------------------------- 1 | module.exports = async function () { 2 | return { 3 | scenarios: [ 4 | { 5 | name: 'ember-lts-3.12', 6 | }, 7 | ], 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/npm/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "lockfileVersion": 1 3 | } 4 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/npm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "engines": { 3 | "node": ">=10" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/npm/testem.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | launch_in_ci: ['Chrome'], 3 | }; 4 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/testem-config-generated-by-ember-cli-3.20/config/ember-try.js: -------------------------------------------------------------------------------- 1 | module.exports = async function () { 2 | return { 3 | scenarios: [ 4 | { 5 | name: 'ember-lts-3.12', 6 | }, 7 | ], 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/testem-config-generated-by-ember-cli-3.20/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "engines": { 3 | "node": "6.* || 8.* || >= 10.*" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/testem-config-generated-by-ember-cli-3.20/testem.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | test_page: 'tests/index.html?hidepassed', 5 | disable_watching: true, 6 | launch_in_ci: ['Chrome'], 7 | launch_in_dev: ['Chrome'], 8 | browser_start_timeout: 120, 9 | browser_args: { 10 | Chrome: { 11 | ci: [ 12 | // --no-sandbox is needed when running Chrome inside a container 13 | process.env.CI ? '--no-sandbox' : null, 14 | '--headless', 15 | '--disable-dev-shm-usage', 16 | '--disable-software-rasterizer', 17 | '--mute-audio', 18 | '--remote-debugging-port=0', 19 | '--window-size=1440,900', 20 | ].filter(Boolean), 21 | }, 22 | }, 23 | }; 24 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/testem-config-generated-by-ember-cli-3.20/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jelhan/create-github-actions-setup-for-ember-addon/cdc8b63ce278fa0ff02a3516ee71d7887982f383/tests/fixtures/defaults/testem-config-generated-by-ember-cli-3.20/yarn.lock -------------------------------------------------------------------------------- /tests/fixtures/defaults/testem-config-including-firefox/config/ember-try.js: -------------------------------------------------------------------------------- 1 | module.exports = async function () { 2 | return { 3 | scenarios: [ 4 | { 5 | name: 'ember-lts-3.12', 6 | }, 7 | ], 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/testem-config-including-firefox/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "engines": { 3 | "node": "6.* || 8.* || >= 10.*" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/testem-config-including-firefox/testem.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | launch_in_ci: ['Chrome', 'Firefox'], 5 | }; 6 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/testem-config-including-firefox/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jelhan/create-github-actions-setup-for-ember-addon/cdc8b63ce278fa0ff02a3516ee71d7887982f383/tests/fixtures/defaults/testem-config-including-firefox/yarn.lock -------------------------------------------------------------------------------- /tests/fixtures/defaults/yarn/config/ember-try.js: -------------------------------------------------------------------------------- 1 | module.exports = async function () { 2 | return { 3 | scenarios: [ 4 | { 5 | name: 'ember-lts-3.12', 6 | }, 7 | ], 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/yarn/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "engines": { 3 | "node": ">=10" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/yarn/testem.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | launch_in_ci: ['Chrome'], 3 | }; 4 | -------------------------------------------------------------------------------- /tests/fixtures/defaults/yarn/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jelhan/create-github-actions-setup-for-ember-addon/cdc8b63ce278fa0ff02a3516ee71d7887982f383/tests/fixtures/defaults/yarn/yarn.lock -------------------------------------------------------------------------------- /tests/fixtures/github-actions/previous-run/.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by create-github-actions-setup-for-ember-addon. 2 | # 3 | # You can upgrade the GitHub Actions workflow to the latest blueprints used 4 | # by Create GitHub Actions setup for Ember Addons by running it again: 5 | # 6 | # - \`yarn create github-actions-setup-for-ember-addon\` if using yarn and 7 | # - \`npm init github-actions-setup-for-ember-addon\` if using NPM. 8 | # 9 | # See https://github.com/jelhan/create-github-actions-setup-for-ember-addon for 10 | # details. 11 | # 12 | # The following lines contain the configuration used in the last run. Please do 13 | # not change them. Doing so could break upgrade flow. 14 | # 15 | #$ browsers: 16 | #$ - chrome 17 | #$ emberTryScenarios: 18 | #$ - scenario: ember-lts-2.16 19 | #$ allowedToFail: false 20 | #$ - scenario: ember-lts-2.18 21 | #$ allowedToFail: false 22 | #$ - scenario: ember-release 23 | #$ allowedToFail: false 24 | #$ - scenario: ember-beta 25 | #$ allowedToFail: false 26 | #$ - scenario: ember-canary 27 | #$ allowedToFail: true 28 | #$ - scenario: ember-default-with-jquery 29 | #$ allowedToFail: false 30 | #$ nodeVersion: 6.x 31 | #$ packageManager: npm 32 | # 33 | -------------------------------------------------------------------------------- /tests/fixtures/travis-ci/ember-3.12-npm/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | # we recommend testing addons with the same minimum supported node version as Ember CLI 5 | # so that your addon works for all apps 6 | - "8" 7 | 8 | sudo: false 9 | dist: trusty 10 | 11 | addons: 12 | chrome: stable 13 | 14 | cache: 15 | directories: 16 | - $HOME/.npm 17 | 18 | env: 19 | global: 20 | # See https://git.io/vdao3 for details. 21 | - JOBS=1 22 | 23 | branches: 24 | only: 25 | - master 26 | # npm version tags 27 | - /^v\d+\.\d+\.\d+/ 28 | 29 | jobs: 30 | fail_fast: true 31 | allow_failures: 32 | - env: EMBER_TRY_SCENARIO=ember-canary 33 | 34 | include: 35 | # runs linting and tests with current locked deps 36 | 37 | - stage: "Tests" 38 | name: "Tests" 39 | script: 40 | - npm run lint:hbs 41 | - npm run lint:js 42 | - npm test 43 | 44 | # we recommend new addons test the current and previous LTS 45 | # as well as latest stable release (bonus points to beta/canary) 46 | - stage: "Additional Tests" 47 | env: EMBER_TRY_SCENARIO=ember-lts-3.4 48 | - env: EMBER_TRY_SCENARIO=ember-lts-3.8 49 | - env: EMBER_TRY_SCENARIO=ember-release 50 | - env: EMBER_TRY_SCENARIO=ember-beta 51 | - env: EMBER_TRY_SCENARIO=ember-canary 52 | - env: EMBER_TRY_SCENARIO=ember-default-with-jquery 53 | 54 | script: 55 | - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 56 | -------------------------------------------------------------------------------- /tests/fixtures/travis-ci/ember-3.16-npm/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | # we recommend testing addons with the same minimum supported node version as Ember CLI 5 | # so that your addon works for all apps 6 | - "10" 7 | 8 | dist: trusty 9 | 10 | addons: 11 | chrome: stable 12 | 13 | cache: 14 | directories: 15 | - $HOME/.npm 16 | 17 | env: 18 | global: 19 | # See https://git.io/vdao3 for details. 20 | - JOBS=1 21 | 22 | branches: 23 | only: 24 | - master 25 | # npm version tags 26 | - /^v\d+\.\d+\.\d+/ 27 | 28 | jobs: 29 | fast_finish: true 30 | allow_failures: 31 | - env: EMBER_TRY_SCENARIO=ember-canary 32 | 33 | include: 34 | # runs linting and tests with current locked deps 35 | - stage: "Tests" 36 | name: "Tests" 37 | script: 38 | - npm run lint:hbs 39 | - npm run lint:js 40 | - npm test 41 | 42 | - stage: "Additional Tests" 43 | name: "Floating Dependencies" 44 | install: 45 | - npm install --no-package-lock 46 | script: 47 | - npm test 48 | 49 | # we recommend new addons test the current and previous LTS 50 | # as well as latest stable release (bonus points to beta/canary) 51 | - env: EMBER_TRY_SCENARIO=ember-lts-3.12 52 | - env: EMBER_TRY_SCENARIO=ember-lts-3.16 53 | - env: EMBER_TRY_SCENARIO=ember-release 54 | - env: EMBER_TRY_SCENARIO=ember-beta 55 | - env: EMBER_TRY_SCENARIO=ember-canary 56 | - env: EMBER_TRY_SCENARIO=ember-default-with-jquery 57 | - env: EMBER_TRY_SCENARIO=ember-classic 58 | 59 | script: 60 | - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 61 | -------------------------------------------------------------------------------- /tests/fixtures/travis-ci/ember-3.20-npm/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | # we recommend testing addons with the same minimum supported node version as Ember CLI 5 | # so that your addon works for all apps 6 | - "10" 7 | 8 | dist: xenial 9 | 10 | addons: 11 | chrome: stable 12 | 13 | cache: 14 | directories: 15 | - $HOME/.npm 16 | 17 | env: 18 | global: 19 | # See https://git.io/vdao3 for details. 20 | - JOBS=1 21 | 22 | branches: 23 | only: 24 | - master 25 | # npm version tags 26 | - /^v\d+\.\d+\.\d+/ 27 | 28 | jobs: 29 | fast_finish: true 30 | allow_failures: 31 | - env: EMBER_TRY_SCENARIO=ember-canary 32 | 33 | include: 34 | # runs linting and tests with current locked deps 35 | - stage: "Tests" 36 | name: "Tests" 37 | script: 38 | - npm run lint 39 | - npm run test:ember 40 | 41 | - stage: "Additional Tests" 42 | name: "Floating Dependencies" 43 | install: 44 | - npm install --no-package-lock 45 | script: 46 | - npm run test:ember 47 | 48 | # we recommend new addons test the current and previous LTS 49 | # as well as latest stable release (bonus points to beta/canary) 50 | - env: EMBER_TRY_SCENARIO=ember-lts-3.12 51 | - env: EMBER_TRY_SCENARIO=ember-lts-3.16 52 | - env: EMBER_TRY_SCENARIO=ember-release 53 | - env: EMBER_TRY_SCENARIO=ember-beta 54 | - env: EMBER_TRY_SCENARIO=ember-canary 55 | - env: EMBER_TRY_SCENARIO=ember-default-with-jquery 56 | - env: EMBER_TRY_SCENARIO=ember-classic 57 | 58 | script: 59 | - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 60 | -------------------------------------------------------------------------------- /tests/fixtures/travis-ci/ember-3.20-yarn/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | # we recommend testing addons with the same minimum supported node version as Ember CLI 5 | # so that your addon works for all apps 6 | - "10" 7 | 8 | dist: xenial 9 | 10 | addons: 11 | chrome: stable 12 | 13 | cache: 14 | yarn: true 15 | 16 | env: 17 | global: 18 | # See https://git.io/vdao3 for details. 19 | - JOBS=1 20 | 21 | branches: 22 | only: 23 | - master 24 | # npm version tags 25 | - /^v\d+\.\d+\.\d+/ 26 | 27 | jobs: 28 | fast_finish: true 29 | allow_failures: 30 | - env: EMBER_TRY_SCENARIO=ember-canary 31 | 32 | include: 33 | # runs linting and tests with current locked deps 34 | - stage: "Tests" 35 | name: "Tests" 36 | script: 37 | - yarn lint 38 | - yarn test:ember 39 | 40 | - stage: "Additional Tests" 41 | name: "Floating Dependencies" 42 | install: 43 | - yarn install --no-lockfile --non-interactive 44 | script: 45 | - yarn test:ember 46 | 47 | # we recommend new addons test the current and previous LTS 48 | # as well as latest stable release (bonus points to beta/canary) 49 | - env: EMBER_TRY_SCENARIO=ember-lts-3.12 50 | - env: EMBER_TRY_SCENARIO=ember-lts-3.16 51 | - env: EMBER_TRY_SCENARIO=ember-lts-3.20 52 | - env: EMBER_TRY_SCENARIO=ember-release 53 | - env: EMBER_TRY_SCENARIO=ember-beta 54 | - env: EMBER_TRY_SCENARIO=ember-canary 55 | - env: EMBER_TRY_SCENARIO=ember-default-with-jquery 56 | - env: EMBER_TRY_SCENARIO=ember-classic 57 | 58 | before_install: 59 | - curl -o- -L https://yarnpkg.com/install.sh | bash 60 | - export PATH=$HOME/.yarn/bin:$PATH 61 | 62 | install: 63 | - yarn install --non-interactive 64 | 65 | script: 66 | - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 67 | -------------------------------------------------------------------------------- /tests/fixtures/travis-ci/ember-3.4-npm/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | # we recommend testing addons with the same minimum supported node version as Ember CLI 5 | # so that your addon works for all apps 6 | - "6" 7 | 8 | sudo: false 9 | dist: trusty 10 | 11 | addons: 12 | chrome: stable 13 | 14 | cache: 15 | directories: 16 | - $HOME/.npm 17 | 18 | env: 19 | global: 20 | # See https://git.io/vdao3 for details. 21 | - JOBS=1 22 | 23 | jobs: 24 | fail_fast: true 25 | allow_failures: 26 | - env: EMBER_TRY_SCENARIO=ember-canary 27 | 28 | include: 29 | # runs linting and tests with current locked deps 30 | 31 | - stage: "Tests" 32 | name: "Tests" 33 | script: 34 | - npm run lint:hbs 35 | - npm run lint:js 36 | - npm test 37 | 38 | # we recommend new addons test the current and previous LTS 39 | # as well as latest stable release (bonus points to beta/canary) 40 | - stage: "Additional Tests" 41 | env: EMBER_TRY_SCENARIO=ember-lts-2.16 42 | - env: EMBER_TRY_SCENARIO=ember-lts-2.18 43 | - env: EMBER_TRY_SCENARIO=ember-release 44 | - env: EMBER_TRY_SCENARIO=ember-beta 45 | - env: EMBER_TRY_SCENARIO=ember-canary 46 | - env: EMBER_TRY_SCENARIO=ember-default-with-jquery 47 | 48 | before_install: 49 | - npm config set spin false 50 | - npm install -g npm@4 51 | - npm --version 52 | 53 | script: 54 | - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 55 | -------------------------------------------------------------------------------- /tests/fixtures/travis-ci/ember-3.8-npm/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: node_js 3 | node_js: 4 | # we recommend testing addons with the same minimum supported node version as Ember CLI 5 | # so that your addon works for all apps 6 | - "6" 7 | 8 | sudo: false 9 | dist: trusty 10 | 11 | addons: 12 | chrome: stable 13 | 14 | cache: 15 | directories: 16 | - $HOME/.npm 17 | 18 | env: 19 | global: 20 | # See https://git.io/vdao3 for details. 21 | - JOBS=1 22 | 23 | branches: 24 | only: 25 | - master 26 | # npm version tags 27 | - /^v\d+\.\d+\.\d+/ 28 | 29 | jobs: 30 | fail_fast: true 31 | allow_failures: 32 | - env: EMBER_TRY_SCENARIO=ember-canary 33 | 34 | include: 35 | # runs linting and tests with current locked deps 36 | 37 | - stage: "Tests" 38 | name: "Tests" 39 | script: 40 | - npm run lint:hbs 41 | - npm run lint:js 42 | - npm test 43 | 44 | # we recommend new addons test the current and previous LTS 45 | # as well as latest stable release (bonus points to beta/canary) 46 | - stage: "Additional Tests" 47 | env: EMBER_TRY_SCENARIO=ember-lts-2.18 48 | - env: EMBER_TRY_SCENARIO=ember-lts-3.4 49 | - env: EMBER_TRY_SCENARIO=ember-release 50 | - env: EMBER_TRY_SCENARIO=ember-beta 51 | - env: EMBER_TRY_SCENARIO=ember-canary 52 | - env: EMBER_TRY_SCENARIO=ember-default-with-jquery 53 | 54 | before_install: 55 | - npm config set spin false 56 | - npm install -g npm@4 57 | - npm --version 58 | 59 | script: 60 | - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO 61 | -------------------------------------------------------------------------------- /tests/utils/fixtures.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { copy, existsSync } from 'fs-extra'; 3 | import execa from 'execa'; 4 | 5 | const fixturesPath = path.join(__dirname, '..', 'fixtures'); 6 | 7 | export async function prepareFixtures( 8 | fixture: string, 9 | tmpDirForTesting: string 10 | ): Promise { 11 | // copy fixture files to testing directory 12 | await copy(path.join(fixturesPath, fixture), tmpDirForTesting); 13 | 14 | // install dependencies 15 | const isYarn = existsSync(path.join(tmpDirForTesting, 'yarn.lock')); 16 | const isNpm = 17 | !isYarn && existsSync(path.join(tmpDirForTesting, 'package-lock.json')); 18 | if (isYarn) { 19 | await execa('yarn', ['install', '--frozen-lockfile'], { 20 | cwd: tmpDirForTesting, 21 | }); 22 | } else if (isNpm) { 23 | await execa('npm', ['ci'], { cwd: tmpDirForTesting }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node12/tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "esModuleInterop": true, 6 | "module": "commonjs", 7 | "outDir": "./dist", 8 | "preserveConstEnums": true, 9 | "typeRoots": [ "./types", "./node_modules/@types"] 10 | }, 11 | "include": ["src/**/*"], 12 | "exclude": ["node_modules", "tests", "types"] 13 | } 14 | -------------------------------------------------------------------------------- /types/js-yaml/index.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copied from @types/js-yaml: 3 | * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d235bae47b2a2abc6f44a0dc1854e763dad4d7f8/types/js-yaml/index.d.ts 4 | * 5 | * Applied this small patch: 6 | * ```diff 7 | * diff --git a/node_modules/@types/js-yaml/index.d.ts b/node_modules/@types/js-yaml/index.d.ts 8 | * index 8dfd30d..654e1f3 100644 9 | * --- a/node_modules/@types/js-yaml/index.d.ts 10 | * +++ b/node_modules/@types/js-yaml/index.d.ts 11 | * @@ -8,7 +8,7 @@ 12 | * 13 | * export as namespace jsyaml; 14 | * 15 | * -export function safeLoad(str: string, opts?: LoadOptions): string | object | undefined; 16 | * +export function safeLoad(str: string, opts?: LoadOptions): string | { [key: string]: any } | undefined; 17 | * export function load(str: string, opts?: LoadOptions): any; 18 | * 19 | * export class Type { 20 | */ 21 | declare module 'js-yaml' { 22 | export function safeLoad( 23 | str: string, 24 | opts?: LoadOptions 25 | ): string | { [key: string]: any } | undefined; 26 | export function load(str: string, opts?: LoadOptions): any; 27 | 28 | export class Type { 29 | constructor(tag: string, opts?: TypeConstructorOptions); 30 | kind: 'sequence' | 'scalar' | 'mapping' | null; 31 | resolve(data: any): boolean; 32 | construct(data: any): any; 33 | instanceOf: object | null; 34 | predicate: ((data: object) => boolean) | null; 35 | represent: 36 | | ((data: object) => any) 37 | | { [x: string]: (data: object) => any } 38 | | null; 39 | defaultStyle: string | null; 40 | styleAliases: { [x: string]: any }; 41 | } 42 | 43 | /* tslint:disable-next-line:no-unnecessary-class */ 44 | export class Schema implements SchemaDefinition { 45 | constructor(definition: SchemaDefinition); 46 | static create(types: Type[] | Type): Schema; 47 | static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema; 48 | } 49 | 50 | export function safeLoadAll( 51 | str: string, 52 | iterator?: null, 53 | opts?: LoadOptions 54 | ): any[]; 55 | export function safeLoadAll( 56 | str: string, 57 | iterator: (doc: any) => void, 58 | opts?: LoadOptions 59 | ): void; 60 | 61 | export function loadAll( 62 | str: string, 63 | iterator?: null, 64 | opts?: LoadOptions 65 | ): any[]; 66 | export function loadAll( 67 | str: string, 68 | iterator: (doc: any) => void, 69 | opts?: LoadOptions 70 | ): void; 71 | 72 | export function safeDump(obj: any, opts?: DumpOptions): string; 73 | export function dump(obj: any, opts?: DumpOptions): string; 74 | 75 | export interface LoadOptions { 76 | /** string to be used as a file path in error/warning messages. */ 77 | filename?: string; 78 | /** function to call on warning messages. */ 79 | onWarning?(this: null, e: YAMLException): void; 80 | /** specifies a schema to use. */ 81 | schema?: SchemaDefinition; 82 | /** compatibility with JSON.parse behaviour. */ 83 | json?: boolean; 84 | /** listener for parse events */ 85 | listener?(this: State, eventType: EventType, state: State): void; 86 | } 87 | 88 | export type EventType = 'open' | 'close'; 89 | 90 | export interface State { 91 | input: string; 92 | filename: string | null; 93 | schema: SchemaDefinition; 94 | onWarning: (this: null, e: YAMLException) => void; 95 | json: boolean; 96 | length: number; 97 | position: number; 98 | line: number; 99 | lineStart: number; 100 | lineIndent: number; 101 | version: null | number; 102 | checkLineBreaks: boolean; 103 | kind: string; 104 | result: any; 105 | implicitTypes: Type[]; 106 | } 107 | 108 | export interface DumpOptions { 109 | /** indentation width to use (in spaces). */ 110 | indent?: number; 111 | /** when true, will not add an indentation level to array elements */ 112 | noArrayIndent?: boolean; 113 | /** do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. */ 114 | skipInvalid?: boolean; 115 | /** specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere */ 116 | flowLevel?: number; 117 | /** Each tag may have own set of styles. - "tag" => "style" map. */ 118 | styles?: { [x: string]: any }; 119 | /** specifies a schema to use. */ 120 | schema?: SchemaDefinition; 121 | /** if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false) */ 122 | sortKeys?: boolean | ((a: any, b: any) => number); 123 | /** set max line width. (default: 80) */ 124 | lineWidth?: number; 125 | /** if true, don't convert duplicate objects into references (default: false) */ 126 | noRefs?: boolean; 127 | /** if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false) */ 128 | noCompatMode?: boolean; 129 | /** 130 | * if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`. 131 | * Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false). 132 | */ 133 | condenseFlow?: boolean; 134 | } 135 | 136 | export interface TypeConstructorOptions { 137 | kind?: 'sequence' | 'scalar' | 'mapping'; 138 | resolve?: (data: any) => boolean; 139 | construct?: (data: any) => any; 140 | instanceOf?: object; 141 | predicate?: (data: object) => boolean; 142 | represent?: 143 | | ((data: object) => any) 144 | | { [x: string]: (data: object) => any }; 145 | defaultStyle?: string; 146 | styleAliases?: { [x: string]: any }; 147 | } 148 | 149 | export interface SchemaDefinition { 150 | implicit?: any[]; 151 | explicit?: Type[]; 152 | include?: Schema[]; 153 | } 154 | 155 | /** only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 */ 156 | export let FAILSAFE_SCHEMA: Schema; 157 | /** only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 */ 158 | export let JSON_SCHEMA: Schema; 159 | /** same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923 */ 160 | export let CORE_SCHEMA: Schema; 161 | /** all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/ */ 162 | export let DEFAULT_SAFE_SCHEMA: Schema; 163 | /** all supported YAML types. */ 164 | export let DEFAULT_FULL_SCHEMA: Schema; 165 | export let MINIMAL_SCHEMA: Schema; 166 | export let SAFE_SCHEMA: Schema; 167 | 168 | export class YAMLException extends Error { 169 | constructor(reason?: any, mark?: any); 170 | toString(compact?: boolean): string; 171 | } 172 | } 173 | --------------------------------------------------------------------------------