Skip to content

Commit 66401a5

Browse files
committed
ci(test): added job for testing compatibility with angular v16
1 parent cfad75a commit 66401a5

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

.github/workflows/test.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
PKG_VERSION=$(cd $GITHUB_WORKSPACE/dist/ionic-header-parallax && npm pkg get version | tr -d '"')
3+
mkdir cypress
4+
cp -r $GITHUB_WORKSPACE/cypress/* ./cypress
5+
cp $GITHUB_WORKSPACE/cypress.config.ts .
6+
cp -r $GITHUB_WORKSPACE/src/app/home/* ./src/app/home
7+
npm i $GITHUB_WORKSPACE/dist/ionic-header-parallax-$PKG_VERSION.tgz
8+
ng serve --host 0.0.0.0 --port 4200 & \
9+
(wait-on http://0.0.0.0:4200 --timeout 30000 --interval 1000 && cypress run --headless) \
10+
|| { echo 'Angular server failed to start'; exit 1; }

.github/workflows/test.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Run Tests
33
on: [push, pull_request]
44

55
jobs:
6-
test:
6+
test-angular19:
77
runs-on: ubuntu-latest
88
container:
99
image: raschidjfr/ionic-blank:ionic8-angular19-cypress14
@@ -20,13 +20,23 @@ jobs:
2020

2121
- name: Run tests
2222
working-directory: /app
23-
run: |
24-
PKG_VERSION=$(cd $GITHUB_WORKSPACE/dist/ionic-header-parallax && npm pkg get version | tr -d '"')
25-
mkdir cypress
26-
cp -r $GITHUB_WORKSPACE/cypress/* ./cypress
27-
cp $GITHUB_WORKSPACE/cypress.config.ts .
28-
cp -r $GITHUB_WORKSPACE/src/app/home/* ./src/app/home
29-
npm i $GITHUB_WORKSPACE/dist/ionic-header-parallax-$PKG_VERSION.tgz
30-
ng serve --host 0.0.0.0 --port 4200 &
31-
(wait-on http://0.0.0.0:4200 --timeout 30000 --interval 1000 && cypress run --headless) \
32-
|| { echo 'Angular server failed to start'; exit 1; }
23+
run: bash $GITHUB_WORKSPACE/.github/workflows/run-tests.sh
24+
25+
test-angular16:
26+
runs-on: ubuntu-latest
27+
container:
28+
image: raschidjfr/ionic-blank:ionic8-angular16-cypress14
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Build project
38+
run: npm run build
39+
40+
- name: Run tests
41+
working-directory: /app
42+
run: bash $GITHUB_WORKSPACE/.github/workflows/run-tests.sh

0 commit comments

Comments
 (0)