-
Notifications
You must be signed in to change notification settings - Fork 2
Description
So far only EMBER_CLI_SCENARIO environment variable is extracted from .travis.yml configuration and used to generate the GitHub Action CI:
create-github-actions-setup-for-ember-addon/src/utils/parse-travis-ci-config.ts
Lines 65 to 74 in e518896
| const emberTryScenarios: string[] = config.jobs.include | |
| .map(({ env }: { env: unknown }): string | null => { | |
| if (typeof env !== 'string') { | |
| return null; | |
| } | |
| const [key, value] = env.split('='); | |
| return key === 'EMBER_TRY_SCENARIO' ? value : null; | |
| }) | |
| .filter((_: string | null) => _ !== null); |
create-github-actions-setup-for-ember-addon/templates/.github/workflows/ci.yml
Lines 204 to 207 in e518896
| ember-try-scenario: [<% | |
| emberTryScenarios.required.forEach(function(scenario, index){ %> | |
| <%- scenario %><% if (index < emberTryScenarios.required.length - 1) { %>,<% }}); %> | |
| ] |
It should be possible to migrate every environment variable defined in TravisCI in that way to GitHub Actions. Instead of ignoring all environment variables, which aren't EMBER_CLI_SCENARIO, we could use a key value map to store them and loop over it in the GitHub Actions creation.
We would need to change the configuration used to generate GitHub Actions.
create-github-actions-setup-for-ember-addon/src/index.ts
Lines 33 to 48 in e518896
| const data: ConfigurationInterface = parseTravisCiConfig() ?? { | |
| browsers: ['chrome', 'firefox'], | |
| emberTryScenarios: { | |
| required: [ | |
| 'ember-lts-3.16', | |
| 'ember-lts-3.20', | |
| 'ember-release', | |
| 'ember-beta', | |
| 'ember-default-with-jquery', | |
| 'ember-classic', | |
| ], | |
| allowedToFail: ['ember-canary', 'embroider-tests'], | |
| }, | |
| nodeVersion: '10.x', | |
| packageManager: 'yarn', | |
| }; |
Maybe something like this:
const data: ConfigurationInterface = parseTravisCiConfig() ?? {
browsers: ['chrome', 'firefox'],
- emberTryScenarios: {
- required: [
- 'ember-lts-3.16',
- 'ember-lts-3.20',
- 'ember-release',
- 'ember-beta',
- 'ember-default-with-jquery',
- 'ember-classic',
- ],
- allowedToFail: ['ember-canary', 'embroider-tests'],
- },
+ jobs: [
+ {
+ environmentVariables: {
+ EMBER_CLI_SCENARIO: 'ember-lts-3.16',
+ },
+ allowedToFail: false,
+ },
+ {
+ environmentVariables: {
+ EMBER_CLI_SCENARIO: 'ember-lts-3.20',
+ },
+ allowedToFail: false,
+ },
+ {
+ environmentVariables: {
+ EMBER_CLI_SCENARIO: 'ember-release',
+ },
+ allowedToFail: false,
+ },
+ {
+ environmentVariables: {
+ EMBER_CLI_SCENARIO: 'ember-beta',
+ },
+ allowedToFail: false,
+ },
+ {
+ environmentVariables: {
+ EMBER_CLI_SCENARIO: 'default-with-jquery',
+ },
+ allowedToFail: false,
+ },
+ {
+ environmentVariables: {
+ EMBER_CLI_SCENARIO: 'ember-canary',
+ },
+ allowedToFail: true,
+ },
+ {
+ environmentVariables: {
+ EMBER_CLI_SCENARIO: 'embroider-tests',
+ },
+ allowedToFail: true,
+ },
+ ]
nodeVersion: '10.x',
packageManager: 'yarn',
};