From 09536194b55c0db5d9a56ff4f935158e5912e692 Mon Sep 17 00:00:00 2001 From: Luke Melia Date: Sat, 16 Sep 2023 01:52:32 -0400 Subject: [PATCH] Add github actions CI --- .github/dependabot.yml | 12 +++++++ .github/workflows/ci.yml | 76 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 64 --------------------------------- config/ember-try.js | 45 +++++++----------------- 4 files changed, 101 insertions(+), 96 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..aa7be59 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - commit-message: + include: "scope" + prefix: "chore" + directory: "/" + open-pull-requests-limit: 10 + package-ecosystem: "npm" + schedule: + interval: "weekly" + time: "10:00" + versioning-strategy: "increase" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e9a21ab --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +name: CI + +on: + push: + branches: + - main + - master + pull_request: {} + +concurrency: + group: ci-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + test: + name: "Tests" + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v3 + - name: Install Node + uses: actions/setup-node@v3 + with: + node-version: 14.x + cache: yarn + - name: Install Dependencies + run: yarn install --frozen-lockfile + - name: Lint + run: yarn lint + - name: Run Tests + run: yarn test:ember + + floating: + name: "Floating Dependencies" + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: yarn + - name: Install Dependencies + run: yarn install --no-lockfile + - name: Run Tests + run: yarn test:ember + + try-scenarios: + name: ${{ matrix.try-scenario }} + runs-on: ubuntu-latest + needs: "test" + timeout-minutes: 10 + + strategy: + fail-fast: false + matrix: + try-scenario: + - ember-lts-3.24 + - ember-lts-3.28 + - ember-classic + - embroider-safe + - embroider-optimized + + steps: + - uses: actions/checkout@v3 + - name: Install Node + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: yarn + - name: Install Dependencies + run: yarn install --frozen-lockfile + - name: Run Tests + run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1ab83d9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,64 +0,0 @@ ---- -language: node_js -node_js: - # we recommend testing addons with the same minimum supported node version as Ember CLI - # so that your addon works for all apps - - "12" - -dist: xenial - -addons: - chrome: stable - -cache: - yarn: true - -env: - global: - # See https://git.io/vdao3 for details. - - JOBS=1 - -branches: - only: - - master - # npm version tags - - /^v\d+\.\d+\.\d+/ - -jobs: - fast_finish: true - allow_failures: - - env: EMBER_TRY_SCENARIO=ember-canary - - include: - # runs linting and tests with current locked deps - - stage: "Tests" - name: "Tests" - script: - - yarn lint - - yarn test:ember - - - stage: "Additional Tests" - name: "Floating Dependencies" - install: - - yarn install --no-lockfile --non-interactive - script: - - yarn test:ember - - # we recommend new addons test the current and previous LTS - # as well as latest stable release (bonus points to beta/canary) - - env: EMBER_TRY_SCENARIO=ember-lts-3.24 - - env: EMBER_TRY_SCENARIO=ember-lts-3.28 - - env: EMBER_TRY_SCENARIO=ember-release - - env: EMBER_TRY_SCENARIO=ember-beta - - env: EMBER_TRY_SCENARIO=ember-canary - - env: EMBER_TRY_SCENARIO=ember-default-with-jquery - - env: EMBER_TRY_SCENARIO=ember-classic - - env: EMBER_TRY_SCENARIO=embroider-safe - - env: EMBER_TRY_SCENARIO=embroider-optimized - -before_install: - - curl -o- -L https://yarnpkg.com/install.sh | bash - - export PATH=$HOME/.yarn/bin:$PATH - -script: - - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO diff --git a/config/ember-try.js b/config/ember-try.js index 8e178a6..698fe4d 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -1,6 +1,6 @@ 'use strict'; -const getChannelURL = require('ember-source-channel-url'); +/* eslint-disable-next-line node/no-missing-require */ const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup'); module.exports = async function () { @@ -12,51 +12,28 @@ module.exports = async function () { npm: { devDependencies: { 'ember-source': '~3.24.3', + 'ember-template-imports': null, }, }, + allowedToFail: true, // to fix this, we need some build-time logic to avoid trying to render gts component }, { name: 'ember-lts-3.28', npm: { devDependencies: { 'ember-source': '~3.28.0', + '@ember/test-helpers': '2.8.1', + 'ember-qunit': '5.1.5', + '@types/ember__test-helpers': '^2.8.1', + '@types/ember-qunit': '^5.0.2', }, }, }, { - name: 'ember-release', + name: 'ember-lts-4.4', npm: { devDependencies: { - 'ember-source': await getChannelURL('release'), - }, - }, - }, - { - name: 'ember-beta', - npm: { - devDependencies: { - 'ember-source': await getChannelURL('beta'), - }, - }, - }, - { - name: 'ember-canary', - npm: { - devDependencies: { - 'ember-source': await getChannelURL('canary'), - }, - }, - }, - { - name: 'ember-default-with-jquery', - env: { - EMBER_OPTIONAL_FEATURES: JSON.stringify({ - 'jquery-integration': true, - }), - }, - npm: { - devDependencies: { - '@ember/jquery': '^1.1.0', + 'ember-source': '~4.4.0', }, }, }, @@ -72,6 +49,10 @@ module.exports = async function () { npm: { devDependencies: { 'ember-source': '~3.28.0', + '@ember/test-helpers': '2.8.1', + 'ember-qunit': '5.1.5', + '@types/ember__test-helpers': '^2.8.1', + '@types/ember-qunit': '^5.0.2', }, ember: { edition: 'classic',