Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable17] Use actions from tutorial #384

Merged
merged 2 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 8 additions & 195 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
kind: pipeline
name: webpack

steps:
- name: build
image: nextcloudci/node:node-4
commands:
- npm ci
- npm run build
- name: changes
image: nextcloudci/node:node-4
commands:
- git status
- bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && exit 1 )"

trigger:
branch:
- master
- stable*

---
kind: pipeline
name: cypress-e2e-testing master
name: cypress-e2e-testing

services:
# nextcloud server
- name: server
image: nextcloudci/server:server-10
image: nextcloudci/server:server-16
commands:
# Add app sources to the app directory
- export BRANCH=$DRONE_TARGET_BRANCH
Expand All @@ -37,7 +16,7 @@ services:
- chown -R www-data:www-data /var/www/html/data

# Install nextcloud, watch logs and run apache
- bash /initnc.sh
- bash /usr/local/bin/initAndRun.sh

steps:
# clone and build the app
Expand All @@ -57,12 +36,13 @@ steps:
- name: wait-on-server
image: nextcloudci/node:node-5
environment:
CYPRESS_baseUrl: http://server/index.php/
LOGIN: login
CYPRESS_baseUrl: http://server/index.php
commands:
- WAIT_ON=$CYPRESS_baseUrl$LOGIN
- WAIT_ON=$CYPRESS_baseUrl
# Add app sources to the app directory
- echo "Waiting for $WAIT_ON"
- npm install -g wait-on
- wait-on -i 500 -t 300000 $WAIT_ON
- wait-on -i 500 -t 120000 $WAIT_ON

- name: testing 1
image: cypress/browsers:chrome69
Expand Down Expand Up @@ -186,170 +166,3 @@ trigger:
branch:
- master
- stable*

---
kind: pipeline
name: cypress-e2e-testing 16

services:
# nextcloud server
- name: server
image: nextcloudci/server:server-10
commands:
# Add app sources to the app directory
- export BRANCH=stable16
- echo "Testing against $BRANCH"
- ln -s /drone/src /var/www/html/apps/viewer
- ls -lLa /var/www/html/apps/viewer
- mkdir /var/www/html/data
- chown -R www-data:www-data /var/www/html/apps/viewer
- chown -R www-data:www-data /var/www/html/data

# Install nextcloud, watch logs and run apache
- bash /initnc.sh

steps:
# clone and build the app
- name: build
image: nextcloudci/node:node-5
volumes:
- name: cache
path: /root/.cache
commands:
- git --no-pager log -1
- npm ci
- npm run build

# wait on server to be ready
- name: wait-on-server
image: nextcloudci/node:node-5
environment:
CYPRESS_baseUrl: http://server/index.php/
LOGIN: login
commands:
- WAIT_ON=$CYPRESS_baseUrl$LOGIN
- npm install -g wait-on
- wait-on -i 500 -t 300000 $WAIT_ON

- name: testing 1
image: cypress/browsers:chrome69
depends_on:
- build
- wait-on-server
# avoid memory process crash
# https://docs.cypress.io/guides/references/error-messages.html#The-Chromium-Renderer-process-just-crashed
resources:
limits:
cpu: 3
memory: 800Mi
requests:
cpu: 0.5
memory: 500Mi
volumes:
- name: cache
path: /root/.cache
- name: droneshm
path: /dev/shm
environment:
CYPRESS_RECORD_TOKEN:
from_secret: cypress_record_token
CYPRESS_baseUrl: http://server/index.php/
LOGIN: login
commands:
- cd /drone/src
- $(npm bin)/cypress run --record --key $CYPRESS_RECORD_TOKEN --parallel --ci-build-id ci-$DRONE_BUILD_NUMBER-16

- name: testing 2
image: cypress/browsers:chrome69
depends_on:
- build
- wait-on-server
# avoid memory process crash
# https://docs.cypress.io/guides/references/error-messages.html#The-Chromium-Renderer-process-just-crashed
resources:
limits:
cpu: 3
memory: 800Mi
requests:
cpu: 0.5
memory: 500Mi
volumes:
- name: cache
path: /root/.cache
- name: droneshm
path: /dev/shm
environment:
CYPRESS_RECORD_TOKEN:
from_secret: cypress_record_token
CYPRESS_baseUrl: http://server/index.php/
LOGIN: login
commands:
- cd /drone/src
- $(npm bin)/cypress run --record --key $CYPRESS_RECORD_TOKEN --parallel --ci-build-id ci-$DRONE_BUILD_NUMBER-16

- name: testing 3
image: cypress/browsers:chrome69
depends_on:
- build
- wait-on-server
# avoid memory process crash
# https://docs.cypress.io/guides/references/error-messages.html#The-Chromium-Renderer-process-just-crashed
resources:
limits:
cpu: 3
memory: 800Mi
requests:
cpu: 0.5
memory: 500Mi
volumes:
- name: cache
path: /root/.cache
- name: droneshm
path: /dev/shm
environment:
CYPRESS_RECORD_TOKEN:
from_secret: cypress_record_token
CYPRESS_baseUrl: http://server/index.php/
LOGIN: login
commands:
- cd /drone/src
- $(npm bin)/cypress run --record --key $CYPRESS_RECORD_TOKEN --parallel --ci-build-id ci-$DRONE_BUILD_NUMBER-16

- name: testing 4
image: cypress/browsers:chrome69
depends_on:
- build
- wait-on-server
# avoid memory process crash
# https://docs.cypress.io/guides/references/error-messages.html#The-Chromium-Renderer-process-just-crashed
resources:
limits:
cpu: 3
memory: 800Mi
requests:
cpu: 0.5
memory: 500Mi
volumes:
- name: cache
path: /root/.cache
- name: droneshm
path: /dev/shm
environment:
CYPRESS_RECORD_TOKEN:
from_secret: cypress_record_token
CYPRESS_baseUrl: http://server/index.php/
LOGIN: login
commands:
- cd /drone/src
- $(npm bin)/cypress run --record --key $CYPRESS_RECORD_TOKEN --parallel --ci-build-id ci-$DRONE_BUILD_NUMBER-16

volumes:
- name: cache
temp: {}
- name: droneshm
temp: {}

trigger:
branch:
- master
- stable*
11 changes: 11 additions & 0 deletions .github/workflows/dependabot-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Dependabot auto approve
on: pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: hmarr/auto-approve-action@v2.0.0
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
69 changes: 42 additions & 27 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,51 @@
name: Lint
on: pull_request

on:
pull_request:
push:
branches:
- master
- stable*

jobs:
php-linters:
php:
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['7.1', '7.2', '7.3']
name: php${{ matrix.php-versions }} lint
php-versions: ['7.2', '7.3', '7.4']

name: php${{ matrix.php-versions }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up php${{ matrix.php-versions }}
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
coverage: none
- name: Lint
run: composer run lint

node-linters:
- uses: actions/checkout@v2

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php-versions }}
coverage: none

- name: Lint
run: composer run lint

node:
runs-on: ubuntu-latest
name: ESLint

strategy:
matrix:
node-versions: [12.x]

name: node${{ matrix.node-versions }}
steps:
- uses: actions/checkout@master
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install
run: npm ci
- name: eslint
run: npm run lint
env:
CI: true
- uses: actions/checkout@v2

- name: Set up node ${{ matrix.node-versions }}
uses: actions/setup-node@v1
with:
node-versions: ${{ matrix.node-versions }}

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint
34 changes: 34 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Node

on:
pull_request:
push:
branches:
- master
- stable*

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-versions: [12.x]

name: node${{ matrix.node-versions }}
steps:
- uses: actions/checkout@v2

- name: Set up node ${{ matrix.node-versions }}
uses: actions/setup-node@v1
with:
node-versions: ${{ matrix.node-versions }}

- name: Install dependencies & build
run: |
npm ci
npm run build --if-present

- name: Check webpack build changes
run: |
bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )"