Skip to content

Commit 3203bec

Browse files
committed
chore: update CI workflows for SDK build and testing
1 parent 7803a2a commit 3203bec

3 files changed

Lines changed: 91 additions & 7 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
- name: Install dependencies
2929
run: npm ci
3030

31-
- name: Build SDK
32-
run: npm run build
31+
- name: Build SDK and pack
32+
run: npm run pack
3333

3434
- name: Verify SDK build
3535
run: |
@@ -42,6 +42,9 @@ jobs:
4242
- name: Install test app dependencies
4343
working-directory: ./test-app
4444
run: npm ci
45+
- name: Install SDK
46+
working-directory: ./test-app
47+
run: npm install ../dist/imagekit-angular/imagekit-angular-*.tgz --no-save
4548
# Note: Playwright browsers are installed via postinstall script
4649

4750
- name: Run Playwright tests

.github/workflows/nodejs.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
2+
name: Node CI
3+
4+
on: [push, pull_request]
5+
6+
jobs:
7+
build:
8+
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node-version: [18.x]
14+
15+
steps:
16+
- uses: actions/checkout@v1
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- name: npm install, build, and test
22+
run: |
23+
npm install -g @angular/cli@17.3.17
24+
npm install
25+
cd test-app
26+
npm run test:e2e:ci
27+
cd ../
28+
npm run build
29+
env:
30+
CI: true
31+
PUBLIC_KEY: ${{ secrets.ik_public_key }}
32+
PRIVATE_KEY: ${{ secrets.ik_private_key }}
33+
URL_ENDPOINT: ${{ secrets.ik_url_endopint }}
34+
e2e:
35+
runs-on: ubuntu-latest
36+
37+
strategy:
38+
matrix:
39+
node-version: [18.x]
40+
steps:
41+
- uses: actions/checkout@v3
42+
43+
- name: Use Node.js ${{ matrix.node-version }}
44+
uses: actions/setup-node@v1
45+
with:
46+
node-version: ${{ matrix.node-version }}
47+
48+
- name: Create e2e environment variables
49+
run: |
50+
cd sdk/src/environments
51+
echo export const environment = { > environment.ts;
52+
echo production: false, >> environment.ts;
53+
echo URL_ENDPOINT:\"https://ik.imagekit.io/sdktestingik\", >> environment.ts;
54+
echo PUBLIC_KEY:\"${{ secrets.ik_public_key }}\", >> environment.ts;
55+
echo '};' >> environment.ts;
56+
less environment.ts
57+
58+
- name: Start client server
59+
run: |
60+
cd sdk
61+
npm install
62+
npm start &
63+
- name: Start auth server
64+
run: |
65+
cd sdk/tests/test-apps/sample-server
66+
echo PRIVATE_KEY=${{ secrets.ik_private_key }} >> .env;
67+
npm install
68+
npm run server &
69+
env:
70+
CI: true
71+
PUBLIC_KEY: ${{ secrets.ik_public_key }}
72+
PRIVATE_KEY: ${{ secrets.ik_private_key }}
73+
URL_ENDPOINT: https://ik.imagekit.io/sdktestingik
74+
- name: Run E2E tests
75+
uses: cypress-io/github-action@v5
76+
with:
77+
install: false
78+
wait-on: 'http://localhost:4200'
79+
working-directory: sdk
80+
env:
81+
DEBUG: 'cypress:server:browsers:electron'
82+
CI: true
83+
PUBLIC_KEY: ${{ secrets.ik_public_key }}
84+
PRIVATE_KEY: ${{ secrets.ik_private_key }}
85+
URL_ENDPOINT: https://ik.imagekit.io/sdktestingik
86+

test-app/tsconfig.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
"ES2022",
2525
"dom"
2626
],
27-
"paths": {
28-
"@imagekit/angular": [
29-
"../dist/imagekit-angular"
30-
]
31-
}
3227
},
3328
"angularCompilerOptions": {
3429
"enableI18nLegacyMessageIdFormat": false,

0 commit comments

Comments
 (0)