|
1 |
| -name: Node CI |
| 1 | +name: Vue 3 CI/CD |
2 | 2 |
|
3 | 3 | on: [push, workflow_dispatch]
|
4 | 4 |
|
5 | 5 | jobs:
|
6 | 6 | build:
|
7 |
| - |
8 | 7 | runs-on: ubuntu-latest
|
9 | 8 |
|
10 | 9 | strategy:
|
11 | 10 | matrix:
|
12 |
| - node-version: [14.x] |
| 11 | + node-version: [16.x] |
13 | 12 |
|
14 | 13 | steps:
|
15 |
| - - uses: actions/checkout@v1 |
16 |
| - - name: Use Node.js ${{ matrix.node-version }} |
17 |
| - uses: actions/setup-node@v1 |
18 |
| - with: |
19 |
| - node-version: ${{ matrix.node-version }} |
20 |
| - - name: npm install, build, and test |
21 |
| - run: | |
22 |
| - npm install |
23 |
| - npm run test:unit |
24 |
| - env: |
25 |
| - CI: true |
26 |
| - VUE_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }} |
27 |
| - VUE_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }} |
28 |
| - VUE_APP_URL_ENDPOINT: ${{ secrets.ik_url_endpoint }} |
| 14 | + - name: Checkout code |
| 15 | + uses: actions/checkout@v2 |
| 16 | + |
| 17 | + - name: Use Node.js ${{ matrix.node-version }} |
| 18 | + uses: actions/setup-node@v2 |
| 19 | + with: |
| 20 | + node-version: ${{ matrix.node-version }} |
| 21 | + |
| 22 | + - name: Install dependencies |
| 23 | + run: npm install |
| 24 | + |
| 25 | + - name: Build and test |
| 26 | + run: | |
| 27 | + npm run build |
| 28 | +
|
| 29 | + - name: Upload coverage to Codecov |
| 30 | + uses: codecov/codecov-action@v1 |
| 31 | + with: |
| 32 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 33 | + file: ./coverage/lcov.info |
| 34 | + flags: unittests |
| 35 | + |
| 36 | + env: |
| 37 | + CI: true |
| 38 | + VUE_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }} |
| 39 | + VUE_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }} |
| 40 | + VUE_APP_URL_ENDPOINT: ${{ secrets.ik_url_endpoint }} |
29 | 41 |
|
30 | 42 | e2e:
|
31 | 43 | runs-on: ubuntu-latest
|
32 | 44 |
|
33 | 45 | strategy:
|
34 | 46 | matrix:
|
35 |
| - node-version: [14.x] |
| 47 | + node-version: [16.x] |
36 | 48 |
|
37 | 49 | steps:
|
38 |
| - - uses: actions/checkout@v1 |
39 |
| - |
40 |
| - - name: Use Node.js ${{ matrix.node-version }} |
41 |
| - uses: actions/setup-node@v1 |
42 |
| - with: |
43 |
| - node-version: ${{ matrix.node-version }} |
44 |
| - |
45 |
| - - name: Setup module and build sample-app |
46 |
| - run: | |
47 |
| - npm install |
48 |
| - cd samples/sample-app |
49 |
| - echo VUE_APP_URL_ENDPOINT = ${{ secrets.ik_url_endpoint }} > .env; |
50 |
| - npm install |
51 |
| - npm run build |
52 |
| -
|
53 |
| - - name: Run E2E tests |
54 |
| - uses: cypress-io/github-action@v2 |
55 |
| - with: |
56 |
| - start: npm run start:sample |
57 |
| - wait-on: http://localhost:3000 |
58 |
| - env: |
59 |
| - CI: true |
60 |
| - VUE_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }} |
61 |
| - VUE_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }} |
62 |
| - VUE_APP_URL_ENDPOINT: ${{ secrets.ik_url_endpoint }} |
| 50 | + - name: Checkout code |
| 51 | + uses: actions/checkout@v2 |
| 52 | + |
| 53 | + - name: Use Node.js ${{ matrix.node-version }} |
| 54 | + uses: actions/setup-node@v2 |
| 55 | + with: |
| 56 | + node-version: ${{ matrix.node-version }} |
| 57 | + |
| 58 | + - name: Install dependencies |
| 59 | + run: | |
| 60 | + npm install |
| 61 | + npm run build |
| 62 | +
|
| 63 | + - name: Build Test app |
| 64 | + run: | |
| 65 | + cd tests/test-app |
| 66 | + echo VUE_APP_URL_ENDPOINT = ${{ secrets.ik_url_endpoint }} > .env; |
| 67 | + echo VUE_APP_PUBLIC_KEY = ${{ secrets.ik_public_key }} >> .env; |
| 68 | + echo VUE_APP_AUTHENTICATION_ENDPOINT = 'http://localhost:3001/auth' >> .env; |
| 69 | + npm install |
| 70 | + npm run build |
| 71 | + cd server |
| 72 | + echo VUE_APP_PRIVATE_KEY = ${{ secrets.ik_private_key }} > .env; |
| 73 | + npm install |
| 74 | +
|
| 75 | + - name: Start the app for Cypress |
| 76 | + run: | |
| 77 | + npm run start:test-app > /dev/null 2>&1 & |
| 78 | + echo "App started successfully" |
| 79 | + npx wait-on http://localhost:3000 |
| 80 | + echo "App is ready" |
| 81 | +
|
| 82 | + - name: Run E2E tests |
| 83 | + uses: cypress-io/github-action@v4 |
| 84 | + with: |
| 85 | + wait-on: http://localhost:3000 |
| 86 | + env: |
| 87 | + DEBUG: 'cypress:server:browsers:electron' |
| 88 | + CI: true |
| 89 | + VUE_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }} |
| 90 | + VUE_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }} |
| 91 | + VUE_APP_URL_ENDPOINT: ${{ secrets.ik_url_endpoint }} |
| 92 | + VUE_APP_AUTHENTICATION_ENDPOINT: http://localhost:3001/auth |
0 commit comments