Merge pull request #92 from imagekit-developer/SDK-68 #499
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: npm install, build, and test | |
run: | | |
npm install -g @angular/cli@1.4.10 | |
cd sdk | |
npm install | |
cd tests/test-apps/sample-server | |
echo PRIVATE_KEY=${{ secrets.ik_private_key }} >> .env; | |
npm install | |
npm run server & | |
cd ../../../ | |
npm run test:ci | |
env: | |
CI: true | |
PUBLIC_KEY: ${{ secrets.ik_public_key }} | |
PRIVATE_KEY: ${{ secrets.ik_private_key }} | |
URL_ENDPOINT: ${{ secrets.ik_url_endopint }} | |
e2e: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Create e2e environment variables | |
run: | | |
cd sdk/src/environments | |
echo export const environment = { > environment.ts; | |
echo production: false, >> environment.ts; | |
echo URL_ENDPOINT:\"https://ik.imagekit.io/sdktestingik\", >> environment.ts; | |
echo PUBLIC_KEY:\"${{ secrets.ik_public_key }}\", >> environment.ts; | |
echo '};' >> environment.ts; | |
less environment.ts | |
- name: Start client server | |
run: | | |
cd sdk | |
npm install | |
npm start & | |
- name: Start auth server | |
run: | | |
cd sdk/tests/test-apps/sample-server | |
echo PRIVATE_KEY=${{ secrets.ik_private_key }} >> .env; | |
npm install | |
npm run server & | |
env: | |
CI: true | |
PUBLIC_KEY: ${{ secrets.ik_public_key }} | |
PRIVATE_KEY: ${{ secrets.ik_private_key }} | |
URL_ENDPOINT: https://ik.imagekit.io/sdktestingik | |
- name: Run E2E tests | |
uses: cypress-io/github-action@v5 | |
with: | |
install: false | |
wait-on: 'http://localhost:4200' | |
working-directory: sdk | |
env: | |
DEBUG: 'cypress:server:browsers:electron' | |
CI: true | |
PUBLIC_KEY: ${{ secrets.ik_public_key }} | |
PRIVATE_KEY: ${{ secrets.ik_private_key }} | |
URL_ENDPOINT: https://ik.imagekit.io/sdktestingik |