Skip to content
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
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
extends: [
'@nextcloud',
]
}
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
js/dist/activity-sidebar.js binary
js/dist/*.LICENCE.map binary
js/dist/*.js.map binary
package-lock.json binary
src/test/__snapshots__/*.snap
69 changes: 69 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Cypress

on: [push]

env:
APP_NAME: activity
CYPRESS_baseUrl: http://localhost:8081/index.php
BRANCH: ${{ github.base_ref }}
PHP_VERSION: 7.4

jobs:
cypress:
name: cypress ${{ matrix.node-version }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [12.x]
# containers: [1, 2, 3]

steps:
- name: Checkout server
uses: actions/checkout@v2
with:
repository: nextcloud/server
submodules: true
ref: ${{ env.BRANCH }}

- name: Checkout ${{ env.APP_NAME }}
uses: actions/checkout@v2
with:
path: apps/${{ env.APP_NAME }}

- name: Set up php ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, apcu
coverage: none

- name: Set up Nextcloud
env:
DB_PORT: 4444
PHP_CLI_SERVER_WORKERS: 10
run: |
mkdir data
php occ maintenance:install --verbose --database=sqlite --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
php occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
php -f index.php
php -S 0.0.0.0:8081 &
export OC_PASS=1234561
php occ user:add --password-from-env user1
php occ user:add --password-from-env user2
php occ config:system:set force_language --value en
php occ app:enable activity
php occ app:list
curl -v http://localhost:8081/index.php/login
cat data/nextcloud.log

- name: Cypress run
uses: cypress-io/github-action@v2
with:
record: false # disabled for now as we have no way to savely use the token in our org
parallel: false
wait-on: '${{ env.CYPRESS_baseUrl }}'
working-directory: 'apps/${{ env.APP_NAME }}'
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
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-version: [12]

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

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

- 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 )"
31 changes: 31 additions & 0 deletions .github/workflows/npm-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

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

jobs:
jest:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12]

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

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

- name: Install dependencies
run: npm ci

- name: Test
run: npm run test
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ nbproject
/tests/karma-coverage
/vendor
/.php_cs.cache

# Vue.js
/build/
node_modules/
js/*hot-update.*
coverage
cypress/screenshots/
cypress/videos/
80 changes: 72 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Makefile for building the project

app_name=activity

project_dir=$(CURDIR)/../$(app_name)
build_dir=$(CURDIR)/build/artifacts
appstore_dir=$(build_dir)/appstore
Expand All @@ -11,10 +7,78 @@ package_name=$(app_name)
cert_dir=$(HOME)/.nextcloud/certificates
version+=master

all: dev-setup

compile-handlebars-templates: dev-setup
bash compile-handlebars-templates.sh

dev-setup:
echo "Done"

# This file is licensed under the Affero General Public License version 3 or
# later. See the COPYING file.
app_name=$(notdir $(CURDIR))
build_tools_directory=$(CURDIR)/build/tools
composer=$(shell which composer 2> /dev/null)

all: dev-setup lint build-js-production test

# Dev env management
dev-setup: clean clean-dev composer npm-init


# Installs and updates the composer dependencies. If composer is not installed
# a copy is fetched from the web
composer:
ifeq (, $(composer))
@echo "No composer command available, downloading a copy from the web"
mkdir -p $(build_tools_directory)
curl -sS https://getcomposer.org/installer | php
mv composer.phar $(build_tools_directory)
php $(build_tools_directory)/composer.phar install --prefer-dist
php $(build_tools_directory)/composer.phar update --prefer-dist
else
composer install --prefer-dist
composer update --prefer-dist
endif

npm-init:
npm ci

npm-update:
npm update

# Building
build-js:
npm run dev

build-js-production:
npm run build

watch-js:
npm run watch

serve-js:
npm run serve

# Linting
lint:
npm run lint

lint-fix:
npm run lint:fix

# Style linting
stylelint:
npm run stylelint

stylelint-fix:
npm run stylelint:fix

# Cleaning
clean:
rm -rf js/*hot-update.*

clean-dev:
rm -rf node_modules

# Tests
test:
./vendor/phpunit/phpunit/phpunit -c phpunit.xml
./vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml
Loading