Porównaj commity

...

6 Commity

Autor SHA1 Wiadomość Data
Max 96b2e4e3f0
fix: try npm 7
https://github.com/nextcloud/social/runs/7740827926?check_suite_focus=true
skjnldsv/read-package-engines-version-actions@v1.2 does not seem to like
the more flexible version specification.
2022-08-09 09:52:21 +02:00
Max 0791026b53
cy: fix login command with flexible selector
Signed-off-by: Max <max@nextcloud.com>
2022-08-09 09:09:38 +02:00
Max 2b435de5c8
ci: cypress action without install
Signed-off-by: Max <max@nextcloud.com>
2022-08-09 09:09:37 +02:00
Max 43321e85fb
fix: provide wait-on as dev dependency and npm script
Signed-off-by: Max <max@nextcloud.com>
2022-08-09 09:09:37 +02:00
Max c78ecfc30a
ci: run cypress like viewer does
Cypress was not working in CI.
Use the CI scripts of the viewer app instead
they are fairly up to date and well maintained.

Changes compared to viewer:
* app name
* default npm version
* default node version
* run composer install during "Install dependencies and build app"

Signed-off-by: Max <max@nextcloud.com>
2022-08-09 08:16:16 +02:00
Nextcloud bot 6a2eee2c21
Update npm and node engines versions
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-08-09 08:16:10 +02:00
6 zmienionych plików z 253 dodań i 32 usunięć

Wyświetl plik

@ -11,57 +11,109 @@ env:
APP_NAME: social
BRANCH: ${{ github.base_ref }}
CYPRESS_baseUrl: http://127.0.0.1:8082/index.php
TESTING: true
jobs:
cypress:
init:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# run 2 copies of the current job in parallel
containers: [1, 2]
node-version: ['12']
php-versions: ['7.4']
name: Runner ${{ matrix.containers }}
steps:
- name: Checkout app
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup server
run: |
cd cypress
docker-compose up -d
- name: Set up node ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.1
id: versions
with:
node-version: ${{ matrix.node-version }}
fallbackNode: '^16'
fallbackNpm: '^7'
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: Install dependencies & build app
run: |
npm ci
composer install
TESTING=true npm run build --if-present
- name: Wait for server
npm run build --if-present
- name: Save context
uses: actions/cache@v3
with:
key: cypress-context-${{ github.run_id }}
path: |
/home/runner/work/social
/home/runner/.cache/Cypress
cypress:
runs-on: ubuntu-latest
needs: init
strategy:
fail-fast: false
matrix:
# run multiple copies of the current job in parallel
containers: [1, 2]
name: runner ${{ matrix.containers }}
steps:
- name: Restore context
uses: actions/cache@v3
with:
key: cypress-context-${{ github.run_id }}
path: |
/home/runner/work/social
/home/runner/.cache/Cypress
- name: Setup server
run: |
npm install -g wait-on
wait-on -i 500 -t 240000 $CYPRESS_baseUrl
cd cypress
docker-compose up -d
- name: Wait for server
run: npm run wait-on $CYPRESS_baseUrl
- name: Enable app & configure server
run: |
cd cypress
docker-compose exec --env APP_NAME=${{ env.APP_NAME }} -T nextcloud bash /initserver.sh
docker-compose exec --env APP_NAME=${{ env.APP_NAME }} --env BRANCH=${{ env.BRANCH }} -T nextcloud bash /initserver.sh
- name: Cypress run
uses: cypress-io/github-action@v1
uses: cypress-io/github-action@v4
with:
record: true
parallel: true
# cypress env
ci-build-id: ${{ github.sha }}-${{ github.run_number }}
tag: ${{ github.event_name }}
install: false
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# https://github.com/cypress-io/github-action/issues/124
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
TESTING: true
- name: Upload snapshots
uses: actions/upload-artifact@v3
if: always()
with:
name: snapshots
path: cypress/snapshots
summary:
runs-on: ubuntu-latest
needs: [init, cypress]
if: always()
name: cypress-summary
steps:
- name: Summary status
run: if ${{ needs.init.result != 'success' || ( needs.cypress.result != 'success' && needs.cypress.result != 'skipped' ) }}; then exit 1; fi

Wyświetl plik

@ -1,16 +1,18 @@
version: '3'
version: '3.7'
services:
nextcloud:
image: nextcloudci/server
image: ghcr.io/nextcloud/continuous-integration-shallow-server
ports:
- 8082:80
environment:
CYPRESS_baseUrl: "http://127.0.0.1:8082/index.php"
BRANCH: master
BRANCH: "${BRANCH:-master}"
volumes:
- ../:/var/www/html/apps/social
# Using fallback to make sure this script doesn't mess
# with the mounting if APP_NAME is not provided.
- ../:/var/www/html/apps/${APP_NAME:-social}
- ./initserver.sh:/initserver.sh

Wyświetl plik

@ -1,6 +1,8 @@
#!/usr/bin/env bash
echo "APP_NAME: $APP_NAME"
echo "BRANCH: $BRANCH"
chown -R www-data:www-data /var/www/html/data
su www-data -c "

Wyświetl plik

@ -33,7 +33,7 @@ Cypress.Commands.add('login', (user, password, route = '/apps/files') => {
cy.visit(route)
cy.get('input[name=user]').type(user)
cy.get('input[name=password]').type(password)
cy.get('#submit-wrapper input[type=submit]').click()
cy.get('form[name=login] [type=submit]').click()
cy.url().should('include', route)
})

163
package-lock.json wygenerowano
Wyświetl plik

@ -74,6 +74,7 @@
"vue-jest": "^3.0.7",
"vue-loader": "^15.9.6",
"vue-template-compiler": "^2.6.14",
"wait-on": "^6.0.1",
"webpack": "^4.46.0",
"webpack-cli": "^4.9.2",
"webpack-merge": "^5.8.0"
@ -2301,6 +2302,21 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@hapi/hoek": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz",
"integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==",
"dev": true
},
"node_modules/@hapi/topo": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz",
"integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==",
"dev": true,
"dependencies": {
"@hapi/hoek": "^9.0.0"
}
},
"node_modules/@humanwhocodes/config-array": {
"version": "0.9.5",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz",
@ -5317,6 +5333,27 @@
"url": "https://opencollective.com/popperjs"
}
},
"node_modules/@sideway/address": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz",
"integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==",
"dev": true,
"dependencies": {
"@hapi/hoek": "^9.0.0"
}
},
"node_modules/@sideway/formula": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz",
"integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==",
"dev": true
},
"node_modules/@sideway/pinpoint": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",
"integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==",
"dev": true
},
"node_modules/@sinclair/typebox": {
"version": "0.23.5",
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.23.5.tgz",
@ -17840,6 +17877,19 @@
"node": ">=8.0"
}
},
"node_modules/joi": {
"version": "17.6.0",
"resolved": "https://registry.npmjs.org/joi/-/joi-17.6.0.tgz",
"integrity": "sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==",
"dev": true,
"dependencies": {
"@hapi/hoek": "^9.0.0",
"@hapi/topo": "^5.0.0",
"@sideway/address": "^4.1.3",
"@sideway/formula": "^3.0.0",
"@sideway/pinpoint": "^2.0.0"
}
},
"node_modules/js-base64": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz",
@ -25747,6 +25797,40 @@
"node": ">=10"
}
},
"node_modules/wait-on": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.1.tgz",
"integrity": "sha512-zht+KASY3usTY5u2LgaNqn/Cd8MukxLGjdcZxT2ns5QzDmTFc4XoWBgC+C/na+sMRZTuVygQoMYwdcVjHnYIVw==",
"dev": true,
"dependencies": {
"axios": "^0.25.0",
"joi": "^17.6.0",
"lodash": "^4.17.21",
"minimist": "^1.2.5",
"rxjs": "^7.5.4"
},
"bin": {
"wait-on": "bin/wait-on"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/wait-on/node_modules/rxjs": {
"version": "7.5.6",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz",
"integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==",
"dev": true,
"dependencies": {
"tslib": "^2.1.0"
}
},
"node_modules/wait-on/node_modules/tslib": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==",
"dev": true
},
"node_modules/walker": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz",
@ -28261,6 +28345,21 @@
}
}
},
"@hapi/hoek": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz",
"integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==",
"dev": true
},
"@hapi/topo": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz",
"integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==",
"dev": true,
"requires": {
"@hapi/hoek": "^9.0.0"
}
},
"@humanwhocodes/config-array": {
"version": "0.9.5",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz",
@ -30578,6 +30677,27 @@
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.6.0.tgz",
"integrity": "sha512-cPqjjzuFWNK3BSKLm0abspP0sp/IGOli4p5I5fKFAzdS8fvjdOwDCfZqAaIiXd9lPkOWi3SUUfZof3hEb7J/uw=="
},
"@sideway/address": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz",
"integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==",
"dev": true,
"requires": {
"@hapi/hoek": "^9.0.0"
}
},
"@sideway/formula": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz",
"integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==",
"dev": true
},
"@sideway/pinpoint": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",
"integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==",
"dev": true
},
"@sinclair/typebox": {
"version": "0.23.5",
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.23.5.tgz",
@ -40244,6 +40364,19 @@
}
}
},
"joi": {
"version": "17.6.0",
"resolved": "https://registry.npmjs.org/joi/-/joi-17.6.0.tgz",
"integrity": "sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==",
"dev": true,
"requires": {
"@hapi/hoek": "^9.0.0",
"@hapi/topo": "^5.0.0",
"@sideway/address": "^4.1.3",
"@sideway/formula": "^3.0.0",
"@sideway/pinpoint": "^2.0.0"
}
},
"js-base64": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz",
@ -46460,6 +46593,36 @@
"xml-name-validator": "^3.0.0"
}
},
"wait-on": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/wait-on/-/wait-on-6.0.1.tgz",
"integrity": "sha512-zht+KASY3usTY5u2LgaNqn/Cd8MukxLGjdcZxT2ns5QzDmTFc4XoWBgC+C/na+sMRZTuVygQoMYwdcVjHnYIVw==",
"dev": true,
"requires": {
"axios": "^0.25.0",
"joi": "^17.6.0",
"lodash": "^4.17.21",
"minimist": "^1.2.5",
"rxjs": "^7.5.4"
},
"dependencies": {
"rxjs": {
"version": "7.5.6",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz",
"integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==",
"dev": true,
"requires": {
"tslib": "^2.1.0"
}
},
"tslib": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==",
"dev": true
}
}
},
"walker": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz",

Wyświetl plik

@ -26,7 +26,8 @@
"test": "jest",
"test:coverage": "jest --coverage",
"cypress": "cypress run",
"cypress:gui": "cypress open"
"cypress:gui": "cypress open",
"wait-on": "wait-on -i 500 -t 300000"
},
"dependencies": {
"@babel/runtime": "^7.17.9",
@ -60,7 +61,7 @@
"not ie <= 11"
],
"engines": {
"node": "^14.0.0",
"node": "^16.0.0",
"npm": "^7.0.0"
},
"devDependencies": {
@ -102,6 +103,7 @@
"vue-jest": "^3.0.7",
"vue-loader": "^15.9.6",
"vue-template-compiler": "^2.6.14",
"wait-on": "^6.0.1",
"webpack": "^4.46.0",
"webpack-cli": "^4.9.2",
"webpack-merge": "^5.8.0"