Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/scripts/set-angular-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const fs = require('fs');

const angularVersion = process.env.ANGULAR_VERSION;
const typescriptVersion = process.env.TYPESCRIPT_VERSION;

if (!angularVersion || !typescriptVersion) {
throw new Error('ANGULAR_VERSION and TYPESCRIPT_VERSION must be set');
}

const path = 'ct-angular/package.json';
const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
const angularDeps = [
'@angular/animations',
'@angular/common',
'@angular/compiler',
'@angular/core',
'@angular/forms',
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/router',
];
const angularDevDeps = [
'@angular/build',
'@angular-devkit/build-angular',
'@angular/cli',
'@angular/compiler-cli',
];

for (const name of angularDeps)
pkg.dependencies[name] = angularVersion;

for (const name of angularDevDeps)
pkg.devDependencies[name] = angularVersion;

pkg.devDependencies.typescript = typescriptVersion;

fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n');
26 changes: 23 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@ on:

jobs:
test:
name: Test
name: Test (Angular ${{ matrix.angular-major }})
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- angular-major: "20"
angular-version: "^20.3.11"
typescript-version: "~5.9.3"
- angular-major: "21"
angular-version: "^21.0.0"
typescript-version: "~5.9.3"
- angular-major: "22"
angular-version: "^22.0.0"
typescript-version: "~6.0.2"
steps:
- name: PNPM Setup
uses: pnpm/action-setup@v6
Expand All @@ -25,8 +38,14 @@ jobs:
node-version: "22.23.1"
cache: "pnpm"

- name: Set Angular test version
run: node .github/scripts/set-angular-version.js
env:
ANGULAR_VERSION: ${{ matrix.angular-version }}
TYPESCRIPT_VERSION: ${{ matrix.typescript-version }}

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: pnpm install --no-frozen-lockfile

- name: Get Playwright version
id: versions
Expand All @@ -45,12 +64,13 @@ jobs:
- uses: actions/upload-artifact@v7
if: always()
with:
name: playwright-report
name: playwright-report-angular-${{ matrix.angular-major }}
path: ./*/**/playwright-report/
retention-days: 30

release:
name: Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
Expand Down
3 changes: 3 additions & 0 deletions ct-angular/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
chrome 120
firefox 120
safari 17
29 changes: 15 additions & 14 deletions ct-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,25 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@analogjs/vite-plugin-angular": "1.17.0",
"@angular/animations": "17.3.8",
"@angular/common": "17.3.8",
"@angular/compiler": "17.3.8",
"@angular/core": "17.3.8",
"@angular/forms": "17.3.8",
"@angular/platform-browser": "17.3.8",
"@angular/platform-browser-dynamic": "17.3.8",
"@angular/router": "17.3.8",
"@angular/animations": "^22.0.0",
"@angular/common": "^22.0.0",
"@angular/compiler": "^22.0.0",
"@angular/core": "^22.0.0",
"@angular/forms": "^22.0.0",
"@angular/platform-browser": "^22.0.0",
"@angular/platform-browser-dynamic": "^22.0.0",
"@angular/router": "^22.0.0",
"rxjs": "7.8.1",
"tslib": "2.6.2",
"zone.js": "0.14.5"
"zone.js": "~0.15.1"
},
"devDependencies": {
"@sand4rt/experimental-ct-angular": "workspace:*",
"@angular-devkit/build-angular": "17.3.7",
"@angular/cli": "17.3.7",
"@angular/compiler-cli": "17.3.8",
"typescript": "5.4.3"
"@angular-devkit/build-angular": "^22.0.0",
"@angular/cli": "^22.0.0",
"@angular/compiler-cli": "^22.0.0",
"typescript": "~6.0.2",
"@analogjs/vite-plugin-angular": "2.8.0",
"@angular/build": "^22.0.0"
}
}
2 changes: 1 addition & 1 deletion ct-angular/tests/angular-router.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from '@sand4rt/experimental-ct-angular';
import type { HooksConfig } from 'playwright';
import type { HooksConfig } from '../playwright';
import { AppComponent } from '@/app.component';

test('navigate to a page by clicking a link', async ({ page, mount }) => {
Expand Down
2 changes: 1 addition & 1 deletion ct-angular/tests/hooks.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@sand4rt/experimental-ct-angular';
import type { HooksConfig } from 'playwright';
import type { HooksConfig } from '../playwright';
import { InjectComponent } from '@/components/inject.component';

test('inject a token', async ({ mount }) => {
Expand Down
1 change: 1 addition & 0 deletions ct-angular/tests/styles.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '*.css';
4 changes: 1 addition & 3 deletions ct-angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
Expand All @@ -13,9 +12,8 @@
"sourceMap": true,
"skipLibCheck": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
"importHelpers": true,
"target": "ES2022",
"module": "ES2022",
Expand Down
18 changes: 9 additions & 9 deletions playwright-ct-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"@playwright/experimental-ct-core": "1.61.1"
},
"devDependencies": {
"@angular/compiler": "^20.3.11",
"@angular/core": "^20.3.11",
"@angular/platform-browser-dynamic": "^20.3.11",
"@angular/compiler": "^22.0.0",
"@angular/core": "^22.0.0",
"@angular/platform-browser-dynamic": "^22.0.0",
"@semantic-release/commit-analyzer": "13.0.1",
"@semantic-release/exec": "7.1.0",
"@semantic-release/git": "10.0.1",
Expand All @@ -66,12 +66,12 @@
"cz-conventional-changelog": "3.3.0",
"rxjs": "~7.8.2",
"semantic-release": "25.0.7",
"typescript": "~7.0.2"
"typescript": "~6.0.2"
},
"peerDependencies": {
"@angular/compiler": "^20.3.11",
"@angular/core": "^20.3.11",
"@angular/platform-browser-dynamic": "^20.3.11",
"typescript": ">=7.0.2"
"@angular/compiler": ">=20.3.11 <23.0.0",
"@angular/core": ">=20.3.11 <23.0.0",
"@angular/platform-browser-dynamic": ">=20.3.11 <23.0.0",
"typescript": ">=5.9.3"
}
}
}
Loading
Loading