Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2cc34929 authored by Ronak Patel's avatar Ronak Patel
Browse files

frontend

parent 5b664dfe
Loading
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+26 −0
Original line number Diff line number Diff line
.DS_Store
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln

.marginalia

build/
coverage/
vendor/
js/

translationtool.phar
.php-cs-fixer.cache
.phpunit.result.cache
junit.xml
.php-cs-fixer.dist.php
+163 −4
Original line number Diff line number Diff line
include:
  - project: 'e/infra/ecloud/nextcloud-apps/ci-templates'
    ref: main
    file: 'nc-apps-checkout-deploy.yml'
stages:
  - lint
  - test
  - static-analysis
  - build
  - package
  - release

.configure-php: &configure-php
  - curl -sSLf -o /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions
  - chmod +x /usr/local/bin/install-php-extensions
  - install-php-extensions gd zip xdebug
  - install-php-extensions @composer

.php-for-lint: &php-for-lint
  image: php:7.4-cli
  stage: lint
  before_script:
    - *configure-php
    - composer install

.setup-nextcloud: &setup-nextcloud
  - apt-get update
  - apt-get -y --no-install-recommends install git
  - cp -r . /tmp/drop_account
  - rm -rf nextcloud # Just in case
  - git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $NEXTCLOUD_VERSION nextcloud
  - php -f nextcloud/occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database sqlite --database-pass=''
  - cp -r /tmp/drop_account nextcloud/apps/

.install-nextcloud-script: &install-nextcloud-script
  before_script:
    - *configure-php
    - *setup-nextcloud
    - cd nextcloud/apps/drop_account
    - composer install

.test-php: &test-php
  <<: *install-nextcloud-script
  stage: test
  parallel:
    matrix:
      - NEXTCLOUD_VERSION: [ stable24 ]
  script:
    - composer run test -- --coverage-text --colors=never --log-junit junit.xml
  variables:
    XDEBUG_MODE: coverage
  artifacts:
    when: always
    paths:
      - nextcloud/apps/drop_account/junit.xml
      - nextcloud/apps/drop_account/coverage/clover.unit.xml
      - nextcloud/apps/drop_account/html-coverage
    reports:
      junit: nextcloud/apps/drop_account/junit.xml

test-7.4:
  <<: *test-php
  image: php:7.4-cli
  parallel:
    matrix:
      - NEXTCLOUD_VERSION: [ stable24, master ]

test-8:
  <<: *test-php
  image: php:8.0-cli
  parallel:
    matrix:
      - NEXTCLOUD_VERSION: [ stable24, master ]

test-8.1:
  <<: *test-php
  image: php:8.1-cli
  parallel:
    matrix:
      - NEXTCLOUD_VERSION: [ master ]
  allow_failure: true

static-analysis:
  <<: *install-nextcloud-script
  stage: static-analysis
  image: php:7.4-cli
  parallel:
    matrix:
      - NEXTCLOUD_VERSION: [ stable24 ]
  script:
    - composer run psalm

build-js:
  stage: build
  image: node:16
  before_script:
    - npm ci
  script:
    - npm run build

lint-xml:
  stage: lint
  image: debian:latest
  before_script:
    - apt-get update && apt-get -y --no-install-recommends install wget libxml2-utils ca-certificates
    - wget https://apps.nextcloud.com/schema/apps/info.xsd
  script:
    - xmllint ./appinfo/info.xml --schema ./info.xsd --noout

lint-php:
  <<: *php-for-lint
  script:
    - composer run lint

php-cs-fixer:
  <<: *php-for-lint
  script:
    - composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

lint-js:
  image: node:16
  stage: lint
  before_script:
    - npm ci
  script:
    - npm run lint

.package: &package
  stage: package
  image: alpine
  before_script:
    - apk update && apk add cargo composer nodejs npm
    - cargo install --git https://github.com/ChristophWurst/krankerl
  script:
    - ~/.cargo/bin/krankerl package

package-main:
  <<: *package
  artifacts:
    paths:
      - build/artifacts/drop_account.tar.gz
    expire_in: 30 days
  only:
    - main@framasoft/nextcloud/drop_account

package-tag:
  <<: *package
  artifacts:
    paths:
      - build/artifacts/drop_account.tar.gz
  only:
    - tags@framasoft/nextcloud/drop_account

release:
  stage: release
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  rules:
    - if: $CI_COMMIT_TAG
  before_script:
    - apk --no-cache add gawk sed grep
    - CHANGELOG=$(awk -v version="$CI_COMMIT_TAG" '/^## / { printit = $2 == version }; printit' CHANGELOG.md | grep -v "## $CI_COMMIT_TAG" | sed '1{/^$/d}')
  script:
    - echo "Running the release job."
  release:
    name: $CI_COMMIT_TAG
    tag_name: $CI_COMMIT_TAG
    description: $CHANGELOG
+6 −0
Original line number Diff line number Diff line
@@ -19,4 +19,10 @@
    <dependencies>
        <nextcloud min-version="21" max-version="23"/>
    </dependencies>
	<settings>
		<!-- <admin>OCA\EcloudAccounts\Settings\Admin</admin> -->
		<personal>OCA\EcloudAccounts\Settings\Personal</personal>
		<personal-section>OCA\EcloudAccounts\Settings\PersonalSection</personal-section>
	</settings>
	
</info>

babel.config.js

0 → 100644
+11 −0
Original line number Diff line number Diff line
module.exports = {
	plugins: ['@babel/plugin-syntax-dynamic-import'],
	presets: [
		[
			'@babel/preset-env',
			{
				modules: false
			}
		]
	]
}

composer.json

0 → 100644
+35 −0
Original line number Diff line number Diff line
{
  "config": {
	"platform": {
	  "php": "7.4"
	}
  },
  "autoload-dev": {
    "psr-4": {
      "OCP\\": "vendor/christophwurst/nextcloud/OCP",
      "OCA\\DropAccount\\": "lib/"
    }
  },
  "scripts": {
    "cs:check": "php-cs-fixer fix --dry-run --diff",
    "cs:fix": "php-cs-fixer fix",
    "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l",
    "psalm": "psalm --threads=1",
    "psalm:update-baseline": "psalm --threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml",
    "psalm:clear": "psalm --clear-cache && psalm --clear-global-cache",
    "psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
  	"test": "phpunit -c phpunit.xml --fail-on-warning"
  },
  "require": {
	"php": ">=7.4"
  },
  "require-dev": {
	"roave/security-advisories": "dev-master",
    "nextcloud/coding-standard": "^1.0.0",
    "vimeo/psalm": "^4.3",
    "christophwurst/nextcloud": "^24.0",
    "christophwurst/nextcloud_testing": "^0.12",
	"phpunit/phpunit": "^9.5.21",
    "psalm/plugin-phpunit": "^0.17.0"
  }
}
Loading