Skip to content

Commit 1fe536e

Browse files
committed
Add tests for vue app
1 parent 964a9f0 commit 1fe536e

33 files changed

+9224
-3213
lines changed

.github/nodejs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Node CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [12.x]
13+
14+
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
21+
run: |
22+
npm ci
23+
npm run build --if-present
24+
- name: npm test
25+
run: |
26+
npm test
27+
- name: check webpack build
28+
run: |
29+
bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )"
30+
env:
31+
CI: true

.github/workflows/cypress.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Cypress
2+
3+
on: [push]
4+
5+
env:
6+
APP_NAME: activity
7+
CYPRESS_baseUrl: http://localhost:8081/index.php
8+
9+
jobs:
10+
cypress:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
node-version: [12.x]
18+
# containers: [1, 2, 3]
19+
php-versions: [ '7.4' ]
20+
databases: [ 'sqlite' ]
21+
server-versions: [ 'master' ]
22+
23+
steps:
24+
- name: Checkout server
25+
uses: actions/checkout@v2
26+
with:
27+
repository: nextcloud/server
28+
ref: ${{ matrix.server-versions }}
29+
30+
- name: Checkout submodules
31+
shell: bash
32+
run: |
33+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
34+
git submodule sync --recursive
35+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
36+
37+
- name: Checkout ${{ env.APP_NAME }}
38+
uses: actions/checkout@v2
39+
with:
40+
path: apps/${{ env.APP_NAME }}
41+
42+
- name: Set up php ${{ matrix.php-versions }}
43+
uses: shivammathur/setup-php@v2
44+
with:
45+
php-version: ${{ matrix.php-versions }}
46+
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, apcu
47+
coverage: none
48+
49+
- name: Set up Nextcloud
50+
env:
51+
DB_PORT: 4444
52+
PHP_CLI_SERVER_WORKERS: 10
53+
run: |
54+
mkdir data
55+
php occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
56+
php occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
57+
php -f index.php
58+
php -S 0.0.0.0:8081 &
59+
export OC_PASS=1234561
60+
php occ user:add --password-from-env user1
61+
php occ user:add --password-from-env user2
62+
php occ config:system:set force_language --value en
63+
php occ app:enable activity
64+
php occ app:list
65+
curl -v http://localhost:8081/index.php/login
66+
cat data/nextcloud.log
67+
68+
- name: Cypress run
69+
uses: cypress-io/github-action@v2
70+
with:
71+
record: false # disabled for now as we have no way to savely use the token in our org
72+
parallel: false
73+
wait-on: '${{ env.CYPRESS_baseUrl }}'
74+
working-directory: 'apps/${{ env.APP_NAME }}'
75+
env:
76+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

.github/workflows/node.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Node
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- stable*
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [12]
17+
18+
name: node${{ matrix.node-version }}
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Set up node ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
27+
- name: Install dependencies & build
28+
run: |
29+
npm ci
30+
npm run build --if-present

.github/workflows/npm-test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- stable*
9+
10+
jobs:
11+
jest:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [12]
17+
18+
name: node${{ matrix.node-version }}
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Set up node ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Test
31+
run: npm run test

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,7 @@ nbproject
6464
# Vue.js
6565
/build/
6666
node_modules/
67-
js/*hot-update.*
67+
js/*hot-update.*
68+
coverage
69+
cypress/screenshots/
70+
cypress/videos/

0 commit comments

Comments
 (0)