Skip to content

Commit

Permalink
Add test-app for each ember major version (#410)
Browse files Browse the repository at this point in the history
* Rename `test-app` folder to `test-app-3.x`

* Add `test-app-5x`

* Add `test-app-4.x` & remove `ember-data` dependency

* Switch from `scenario-tester` to `ember-try`

* Fix ci

* Fix lint

* Fix lint

* Update ci & gitignore

* Add `--test-port 0` to fix test

* Remove `test:ember-compatibility`

* Fix ci

* Update ci

* Use `concurrently` in test-app-3.x

* Update ci

* Add rule for helper

* Add `concurrently` to 3.x test app

* Fix testapp 3.x

* Try to fix embroider

* Set `@embroider/test-setup` to v4

* Fix package log and prepare script

* Remove `npm-run-all` not anymore needed, we are on pnpm

* Remove .eslintcache file

* Update ember-try in test-app v3

* Add npmignore to new test-apps & fix gitignore

* Fix ci

* Add nolockfile for try-scenarios

* Try to fix resolver

* Remove resolver

* Move helper to test-app helper inside app to fix embroider-safe
  • Loading branch information
mkszepp authored Jun 26, 2024
1 parent 9ac455b commit 2e9e788
Show file tree
Hide file tree
Showing 226 changed files with 7,900 additions and 1,479 deletions.
6 changes: 3 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

# compiled output
/dist/
/test-app/dist
/test-app/tmp
/test-app-3.x/dist
/test-app-3.x/tmp

# dependencies
/bower_components/
/node_modules/
/test-app/node_modules
/test-app-3.x/node_modules

# misc
/coverage/
Expand Down
112 changes: 91 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,115 @@
name: Node CI
name: CI

on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
- master
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
lint:
test:
name: "Tests"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm lint
- name: Lint
run: pnpm lint
- name: Run Tests
run: pnpm test

test:
floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm test:ember
- id: set-matrix
run: echo "::set-output name=matrix::$(pnpm scenario-tester list --files ./scenarios.js --matrix 'pnpm qunit ./scenarios.js --filter %s:')"
working-directory: test-app
- name: Run Tests
run: pnpm test

try-scenarios-ember-3x:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: 'test'
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.16
- ember-lts-3.20
- ember-lts-3.24
- ember-lts-3.28
- embroider-safe
- embroider-optimized

compat-scenarios:
needs: test
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
with:
args: "--no-lockfile"
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup
working-directory: test-app-3.x

try-scenarios-ember-4x:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: 'test'
timeout-minutes: 10

strategy:
fail-fast: false
matrix: ${{fromJson(needs.test.outputs.matrix)}}
matrix:
try-scenario:
- ember-lts-4.4
- ember-lts-4.8
- ember-lts-4.12
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
with:
args: "--no-lockfile"
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup
working-directory: test-app-4.x

try-scenarios-ember-5x:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: 'test'
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-5.4
- ember-lts-5.8
- ember-release
- ember-beta
- ember-canary
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: ${{ matrix.command }}
working-directory: test-app
with:
args: "--no-lockfile"
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup
working-directory: test-app-5.x
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/test-app/dist/
/test-app/tmp/
dist/
tmp/

# dependencies
/node_modules/
/test-app/node_modules
node_modules/

# misc
/.env*
/.pnp*
/.sass-cache
/.eslintcache
.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
Expand Down
35 changes: 8 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,16 @@
"dist"
],
"scripts": {
"clean": "rm -rf dist node_modules test-app/node_modules",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"lint:devdeps": "addon-dev sync-dev-deps --lint",
"scenario:list": "scenario-tester list --files test-app/scenarios.js",
"scenario:output": "scenario-tester output --files test-app/scenarios.js --outdir scenario --scenario ",
"scenario:run": "cd test-app && qunit scenarios.js --filter ",
"start": "npm-run-all --parallel start:*",
"start:test-app": "cd test-app && ember serve",
"clean": "rm -rf dist node_modules test-app-3.x/node_modules test-app-4.x/node_modules test-app-5.x/node_modules",
"lint": "pnpm --filter '*' lint",
"lint:fix": "pnpm --filter '*' lint:fix",
"start": "concurrently 'pnpm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:test-app": "pnpm --filter test-app-5.x start",
"start:build": "rollup --config --watch",
"sync-dev-deps": "addon-dev sync-dev-deps",
"test": "npm-run-all lint:* test:*",
"test:ember": "cd test-app && ember test",
"test:ember-compatibility": "cd test-app && qunit scenarios.js",
"prepare": "npm-run-all prepublishOnly",
"test": "pnpm --filter '*' test",
"test:ember": "pnpm --filter '*' test:ember",
"prepare": "pnpm run prepublishOnly",
"prepublishOnly": "rollup --config"
},
"dependencies": {
Expand All @@ -57,14 +51,9 @@
"babel-eslint": "^10.1.0",
"ember-auto-import": "^2.3.0",
"ember-cli": "~3.28.5",
"ember-cli-3.16": "npm:ember-cli@~3.16.0",
"ember-cli-3.20": "npm:ember-cli@~3.20.0",
"ember-cli-3.24": "npm:ember-cli@~3.24.0",
"ember-cli-babel": "^7.26.10",
"ember-cli-beta": "npm:ember-cli@beta",
"ember-cli-htmlbars": "^5.7.2",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-latest": "npm:ember-cli@latest",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.2",
"ember-disable-prototype-extensions": "^1.1.3",
Expand All @@ -75,13 +64,7 @@
"ember-qunit": "^5.1.5",
"ember-resolver": "^8.0.3",
"ember-source": "~3.28.8",
"ember-source-3.16": "npm:ember-source@~3.16.0",
"ember-source-3.20": "npm:ember-source@~3.20.0",
"ember-source-3.24": "npm:ember-source@~3.24.0",
"ember-source-beta": "npm:ember-source@beta",
"ember-source-canary": "npm:ember-source@alpha",
"ember-source-channel-url": "^3.0.0",
"ember-source-latest": "npm:ember-source@latest",
"ember-template-lint": "^3.15.0",
"ember-try": "^1.4.0",
"eslint": "^7.32.0",
Expand All @@ -93,14 +76,12 @@
"jquery": "^3.6.0",
"loader.js": "^4.7.0",
"moment-timezone": "^0.5.33",
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"qunit": "^2.17.2",
"qunit-console-grouper": "^0.3.0",
"qunit-dom": "^1.6.0",
"release-plan": "^0.9.0",
"rollup": "^2.63.0",
"scenario-tester": "^2.0.1",
"webpack": "^5.65.0"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 2e9e788

Please sign in to comment.