Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2022-07-05 16:42:36 +0300
committerdartcafe <github@dartcafe.de>2022-07-05 16:42:36 +0300
commit0919adc872540bd77bfc30f2d118c8b83681fcf6 (patch)
tree9f1b9ce790e83e5b5a785713944f33137da52fa4
parentf2b6a95eaf2b913b74b4fbcd0eb0e165571088ab (diff)
modularize workflows and add cachingdev/workflows
Signed-off-by: dartcafe <github@dartcafe.de>
-rw-r--r--.github/actions/get-polls-version/action.yml37
-rw-r--r--.github/actions/setup-composer/action.yml65
-rw-r--r--.github/actions/setup-node/action.yml37
-rw-r--r--.github/actions/setup-server/action.yml96
-rw-r--r--.github/workflows/lint.yml66
-rw-r--r--.github/workflows/nodejs.yml35
-rw-r--r--.github/workflows/phpunit.yml184
-rw-r--r--.github/workflows/publish_beta.yml70
-rw-r--r--.github/workflows/static-analysis.yml43
-rw-r--r--appinfo/info.xml2
10 files changed, 393 insertions, 242 deletions
diff --git a/.github/actions/get-polls-version/action.yml b/.github/actions/get-polls-version/action.yml
new file mode 100644
index 00000000..05820fb8
--- /dev/null
+++ b/.github/actions/get-polls-version/action.yml
@@ -0,0 +1,37 @@
+name: Read polls version from info.xml
+inputs:
+ skip-check:
+ description: Do not check tag against version
+ required: false
+ type: boolean
+ default: false
+
+outputs:
+ app-version:
+ description: 'Version string from app'
+ value: ${{ steps.appinfo.outputs.info }}
+ tag-version:
+ description: 'Version string from tag'
+ value: ${{ steps.gettag.outputs.VERSION }}
+
+runs:
+ using: "composite"
+ steps:
+ - name: Get app version from appinfo/info.xml
+ id: appinfo
+ uses: mavrosxristoforos/get-xml-info@1.0
+ with:
+ xml-file: 'appinfo/info.xml'
+ xpath: '//info//version'
+
+ - name: Get tag name
+ id: gettag
+ run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
+ shell: bash
+
+ - name: Compare versions
+ if: ${{ !inputs.skip-version && format('v{0}', steps.appinfo.outputs.info) != steps.gettag.outputs.VERSION }}
+ uses: actions/github-script@v3
+ with:
+ script: |
+ core.setFailed('App version ${{ format('v{0}', steps.appinfo.outputs.info) }} is not equal to tag name ${{ steps.gettag.outputs.VERSION }}!')
diff --git a/.github/actions/setup-composer/action.yml b/.github/actions/setup-composer/action.yml
new file mode 100644
index 00000000..24d5e237
--- /dev/null
+++ b/.github/actions/setup-composer/action.yml
@@ -0,0 +1,65 @@
+name: Setup composer and PHP
+inputs:
+ php-version:
+ description: 'PHP version (default: 7.4)'
+ required: false
+ default: '7.4'
+ php-tools:
+ description: 'Additional php tools'
+ required: false
+ type: string
+ php-extensions:
+ description: 'extensions to add to php'
+ required: false
+ type: string
+ mode:
+ description: 'Composer install mode (dev, production, default: dev)'
+ required: false
+ type: string
+ default: 'dev'
+ working-directory:
+ description: 'deployment directory'
+ required: false
+ type: string
+ default: ''
+
+outputs:
+ cache-hit:
+ description: 'Return cache hit'
+ value: ${{ steps.cache-composer.outputs.cache-hit }}
+
+runs:
+ using: "composite"
+ steps:
+ - name: Use or setup caching composer packages (${{ inputs.mode }})
+ uses: actions/cache@v3
+ id: cache-composer
+ env:
+ cache-name: cache-composer-${{ inputs.mode }}
+ with:
+ path: vendor
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Set up php ${{ inputs.php-version }}
+ uses: shivammathur/setup-php@master
+ with:
+ php-version: ${{ inputs.php-version }}
+ tools: ${{ inputs.php-tools }}
+ extensions: ${{ inputs.php-extensions }}
+ coverage: none
+
+ - name: Install dev packages
+ if: steps.cache-composer.outputs.cache-hit != 'true' && inputs.mode == 'dev'
+ working-directory: ${{ inputs.working-directory }}
+ run: composer i
+ shell: bash
+
+ - name: Install production packages
+ if: steps.cache-composer.outputs.cache-hit != 'true' && inputs.mode == 'production'
+ working-directory: ${{ inputs.working-directory }}
+ run: composer i -o
+ shell: bash
diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml
new file mode 100644
index 00000000..565a53d7
--- /dev/null
+++ b/.github/actions/setup-node/action.yml
@@ -0,0 +1,37 @@
+name: Setup node and dependencies
+inputs:
+ node-version:
+ required: false
+ default: 16
+ description: 'Node version to use'
+
+outputs:
+ cache-hit:
+ description: 'Return cache hit'
+ value: ${{ steps.cache-modules.outputs.cache-hit }}
+
+runs:
+ using: "composite"
+ steps:
+ - name: Use or setup caching npm modules
+ uses: actions/cache@v3
+ id: cache-modules
+ env:
+ cache-name: cache-node-modules
+ with:
+ path: node_modules
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-
+ ${{ runner.os }}-build-
+ ${{ runner.os }}-
+
+ - name: Set up node ${{ inputs.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-versions }}
+
+ - name: Install dependencies
+ if: steps.cache-modules.outputs.cache-hit != 'true'
+ run: npm ci
+ shell: bash \ No newline at end of file
diff --git a/.github/actions/setup-server/action.yml b/.github/actions/setup-server/action.yml
new file mode 100644
index 00000000..06182e58
--- /dev/null
+++ b/.github/actions/setup-server/action.yml
@@ -0,0 +1,96 @@
+name: Checkout and setup server
+inputs:
+ server-version:
+ required: false
+ default: 'master'
+ description: 'Define Nextcloud branch (default: master)'
+ app-name:
+ required: false
+ default: 'polls'
+ description: 'App to checkout (default: polls)'
+ php-version:
+ required: false
+ default: '7.4'
+ description: 'PHP version (default: 7.4)'
+ server-path:
+ required: false
+ default: server
+ desrcription: 'Server path (default: server)'
+ db-host:
+ required: false
+ default: 127.0.0.1
+ desrcription: 'Server path (Default: 127.0.0.1)'
+ db-engine:
+ required: false
+ default: 'sqlite'
+ description: 'Database system to use (sqlite, mysql, pgsql, Default: sqlite)'
+ db-port:
+ required: false
+ type: number
+ default: 4444
+ description: 'Database port to use (default: 4444)'
+ db-name:
+ required: false
+ default: nextcloud
+ desrcription: 'Database name (Default: nextcloud)'
+ db-username:
+ required: false
+ default: root
+ desrcription: 'Database root user (Default: root)'
+ db-password:
+ required: false
+ default: rootpassword
+ desrcription: 'Database root password (Default: rootpassword)'
+ admin-user:
+ required: false
+ default: admin
+ desrcription: 'User id of the admin user (Default: admin)'
+ admin-password:
+ required: false
+ default: password
+ desrcription: 'Password of the admin user (Default: password)'
+
+runs:
+ using: "composite"
+ steps:
+ - name: Checkout server ${{ inputs.server-version }}
+ uses: actions/checkout@v2
+ with:
+ path: ${{ inputs.server-path }}
+ repository: nextcloud/server
+ ref: ${{ inputs.server-version }}
+
+ - name: Checkout submodules
+ working-directory: ${{ inputs.server-path }}
+ shell: bash
+ run: |
+ auth_header="$(git config --local --get http.https://github.com/.extraheader)"
+ git submodule sync --recursive
+ git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
+
+ - name: Checkout ${{ inputs.app-name }}
+ uses: actions/checkout@v2
+ with:
+ path: ${{ inputs.server-path }}/apps/${{ inputs.app-name }}
+
+ - name: Set up php ${{ inputs.php-version }}
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ inputs.php-version }}
+ tools: phpunit
+ extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql, zip, gd
+ coverage: none
+
+ - name: Set up components
+ working-directory: ${{ inputs.server-path }}/apps/${{ inputs.app-name }}
+ shell: bash
+ run: composer i
+
+ - name: Set up Nextcloud
+ working-directory: ${{ inputs.server-path }}
+ shell: bash
+ run: |
+ mkdir data
+ ./occ maintenance:install --verbose --database=${{ inputs.db-engine }} --database-name=${{ inputs.db-name }} --database-host=${{ inputs.db-host }} --database-port=${{ inputs.db-port }} --database-user=${{ inputs.db-username }} --database-pass=${{ inputs.db-password }} --admin-user ${{ inputs.admin-user }} --admin-pass ${{ inputs.admin-password }}
+ ./occ app:enable --force ${{ inputs.app-name }}
+ php -S localhost:8080 &
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 4fc25997..df28fad1 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -8,69 +8,57 @@ on:
- stable*
jobs:
- php-cs-fixer:
+ php-cs:
runs-on: ubuntu-latest
strategy:
matrix:
- php-versions: ['7.4', '8.0']
+ php-versions: ['7.4', '8.0', '8.1']
- name: php-cs php${{ matrix.php-versions }}
+ name: PHP CS php${{ matrix.php-versions }}
steps:
- - name: Checkout
+ - name: Checkout repository
uses: actions/checkout@v2
- - name: Set up php
- uses: shivammathur/setup-php@master
+
+ - name: Setup composer and PHP
+ uses: ./.github/actions/setup-composer
with:
php-version: ${{ matrix.php-versions }}
- coverage: none
- - name: Install dependencies
- run: composer i
+ php-tools: composer, phpunit
+
- name: Run coding standards check
run: composer run cs:check
- lint:
+ eslint:
runs-on: ubuntu-latest
- strategy:
- matrix:
- node-versions: [14.x]
- npm-versions: [7]
-
- name: eslint node${{ matrix.node-versions }} npm${{ matrix.npm-versions }}
+ name: ${{ inputs.lint }} node${{ inputs.node-version }}
steps:
- - uses: actions/checkout@v2
- - name: Use node ${{ matrix.node-versions }}
- uses: actions/setup-node@v2
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - name: Setup node
+ uses: ./.github/actions/setup-node
with:
- node-version: ${{ matrix.node-versions }}
- - name: Set up npm ${{ matrix.npm-versions }}
- run: npm i -g npm@"${{ matrix.npm-versions }}"
- - name: Install dependencies
- run: npm ci
- - name: Run Lint
+ node-version: '16'
+
+ - name: Run eslint
run: npm run lint
stylelint:
runs-on: ubuntu-latest
- strategy:
- matrix:
- node-versions: [14.x]
- npm-versions: [7]
-
- name: stylelint node${{ matrix.node-versions }} npm${{ matrix.npm-versions }}
+ name: ${{ inputs.lint }} node${{ inputs.node-version }}
steps:
- - uses: actions/checkout@v2
+ - name: Checkout repository
+ uses: actions/checkout@v2
- - name: Set up node ${{ matrix.node-versions }}
- uses: actions/setup-node@v2
+ - name: Setup node
+ uses: ./.github/actions/setup-node
with:
- node-version: ${{ matrix.node-versions }}
- - name: Set up npm ${{ matrix.npm-version }}
- run: npm i -g npm@"${{ matrix.npm-version }}"
- - name: Install dependencies
- run: npm ci
+ node-version: '16'
+
- name: Run stylelint
run: npm run stylelint
+
diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml
index 43f3e65a..cb336885 100644
--- a/.github/workflows/nodejs.yml
+++ b/.github/workflows/nodejs.yml
@@ -1,27 +1,24 @@
name: Node CI
-on: [push]
+on:
+ pull_request:
+ push:
+ branches:
+ - master
+ - stable*
jobs:
build:
-
runs-on: ubuntu-latest
+ name: Build app
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
- strategy:
- matrix:
- node-versions: [14.x, 16.x]
- npm-versions: [7]
+ - name: Setup node
+ uses: ./.github/actions/setup-node
+ with:
+ node-version: '16'
- name: build node${{ matrix.node-versions }} npm${{ matrix.npm-versions }}
- steps:
- - uses: actions/checkout@v2
- - name: Use Node.js ${{ matrix.node-versions }}
- uses: actions/setup-node@v2
- with:
- node-version: ${{ matrix.node-versions }}
- - name: Set up npm ${{ matrix.npm-versions }}
- run: npm i -g npm@"${{ matrix.npm-versions }}"
- - name: install dependencies
- run: npm ci
- - name: build
- run: npm run build --if-present
+ - name: build
+ run: npm run build --if-present
diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml
index 396c29f5..f7798bce 100644
--- a/.github/workflows/phpunit.yml
+++ b/.github/workflows/phpunit.yml
@@ -9,6 +9,11 @@ on:
env:
APP_NAME: polls
+ DB_PORT: 4444
+ SERVER_PATH: server
+ DB_USER: root
+ DB_PASSWORD: rootpassword
+ DB_NAME: nextcloud
jobs:
sqlite:
@@ -18,72 +23,45 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
- php-versions: ['7.4', '8.0']
- databases: ['sqlite']
- server-versions: ['master', 'stable21']
+ php-versions: ['7.4', '8.0', '8.1']
+ server-versions: ['master']
- name: PHPUnit php${{ matrix.php-versions }} ${{ matrix.databases }} ${{ matrix.server-versions }}
+ name: PHPUnit php${{ matrix.php-versions }}-sqlite-${{ matrix.server-versions }}
steps:
- - name: Checkout server
- uses: actions/checkout@v2
+ - uses: actions/checkout@v2
with:
- repository: nextcloud/server
- ref: ${{ matrix.server-versions }}
-
- - name: Checkout submodules
- shell: bash
- run: |
- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
- git submodule sync --recursive
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
-
- - name: Checkout app
- uses: actions/checkout@v2
- with:
- path: apps/${{ env.APP_NAME }}
+ path: src
- - name: Set up php ${{ matrix.php-versions }}
- uses: shivammathur/setup-php@v2
+ - name: Setup server
+ uses: ./src/.github/actions/setup-server
with:
+ server-version: ${{ matrix.server-versions }}
php-version: ${{ matrix.php-versions }}
- tools: phpunit
- extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, zip, gd
- coverage: none
-
- - name: Set up PHPUnit
- working-directory: apps/${{ env.APP_NAME }}
- run: composer i
-
- - name: Set up Nextcloud
- env:
- DB_PORT: 4444
- run: |
- mkdir data
- ./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 password
- ./occ app:enable --force ${{ env.APP_NAME }}
- php -S localhost:8080 &
+ server-path: ${{ env.SERVER_PATH }}
+ db-engine: sqlite
+ db-port: ${{ env.DB_PORT}}
+ db-password: ${{ env.DB_PASSWORD }}
+ db-username: ${{ env.DB_USER }}
+ db-name: ${{ env.DB_NAME }}
- name: PHPUnit
- working-directory: apps/${{ env.APP_NAME }}
+ working-directory: ${{ env.SERVER_PATH }}/apps/${{ env.APP_NAME }}
run: ./vendor/phpunit/phpunit/phpunit -c tests/phpunit.xml
- name: PHPUnit integration
- working-directory: apps/${{ env.APP_NAME }}
+ working-directory: ${{ env.SERVER_PATH }}/apps/${{ env.APP_NAME }}
run: ./vendor/phpunit/phpunit/phpunit -c tests/phpunit.integration.xml
mysql:
runs-on: ubuntu-latest
-
strategy:
- # do not stop on another job's failure
fail-fast: false
matrix:
php-versions: ['8.0']
- databases: ['mysql']
- server-versions: ['master', 'stable22']
+ server-versions: ['stable24', 'stable23']
- name: PHPUnit php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}
+ name: PHPUnit php${{ matrix.php-versions }}-mysql-${{ matrix.server-versions }}
services:
mysql:
@@ -91,69 +69,43 @@ jobs:
ports:
- 4444:3306/tcp
env:
- MYSQL_ROOT_PASSWORD: rootpassword
+ MYSQL_ROOT_PASSWORD: ${{ env.DB_PASSWORD }}
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5
steps:
- - name: Checkout server
- uses: actions/checkout@v2
- with:
- repository: nextcloud/server
- ref: ${{ matrix.server-versions }}
-
- - name: Checkout submodules
- shell: bash
- run: |
- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
- git submodule sync --recursive
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
-
- - name: Checkout app
- uses: actions/checkout@v2
+ - uses: actions/checkout@v2
with:
- path: apps/${{ env.APP_NAME }}
-
- - name: Set up php ${{ matrix.php-versions }}
- uses: shivammathur/setup-php@v2
+ path: src
+ - name: Prepare server
+ uses: ./src/.github/actions/setup-server
with:
+ server-version: ${{ matrix.server-versions }}
php-version: ${{ matrix.php-versions }}
- tools: phpunit
- extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql, zip, gd
- coverage: none
-
- - name: Set up PHPUnit
- working-directory: apps/${{ env.APP_NAME }}
- run: composer i
-
- - name: Set up Nextcloud
- env:
- DB_PORT: 4444
- run: |
- mkdir data
- ./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 password
- ./occ app:enable --force ${{ env.APP_NAME }}
- php -S localhost:8080 &
+ server-path: ${{ env.SERVER_PATH }}
+ db-engine: 'mysql'
+ db-port: ${{ env.DB_PORT }}
+ db-password: ${{ env.DB_PASSWORD }}
+ db-username: ${{ env.DB_USER }}
+ db-name: ${{ env.DB_NAME }}
- name: PHPUnit
- working-directory: apps/${{ env.APP_NAME }}
+ working-directory: ${{ env.SERVER_PATH }}/apps/${{ env.APP_NAME }}
run: ./vendor/phpunit/phpunit/phpunit -c tests/phpunit.xml
- name: PHPUnit integration
- working-directory: apps/${{ env.APP_NAME }}
+ working-directory: ${{ env.SERVER_PATH }}/apps/${{ env.APP_NAME }}
run: ./vendor/phpunit/phpunit/phpunit -c tests/phpunit.integration.xml
pgsql:
runs-on: ubuntu-latest
-
strategy:
# do not stop on another job's failure
fail-fast: false
matrix:
- php-versions: ['8.0']
- databases: ['pgsql']
- server-versions: ['master', 'stable23']
+ php-versions: ['7.4']
+ server-versions: ['stable22', 'stable21']
- name: PHPUnit php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}
+ name: PHPUnit php${{ matrix.php-versions }}-pgsql-${{ matrix.server-versions }}
services:
postgres:
@@ -161,55 +113,31 @@ jobs:
ports:
- 4444:5432/tcp
env:
- POSTGRES_USER: root
- POSTGRES_PASSWORD: rootpassword
- POSTGRES_DB: nextcloud
+ POSTGRES_USER: ${{ env.DB_USER }}
+ POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
+ POSTGRES_DB: ${{ env.DB_NAME }}
options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5
steps:
- - name: Checkout server
- uses: actions/checkout@v2
+ - uses: actions/checkout@v2
with:
- repository: nextcloud/server
- ref: ${{ matrix.server-versions }}
-
- - name: Checkout submodules
- shell: bash
- run: |
- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
- git submodule sync --recursive
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
-
- - name: Checkout app
- uses: actions/checkout@v2
- with:
- path: apps/${{ env.APP_NAME }}
-
- - name: Set up php ${{ matrix.php-versions }}
- uses: shivammathur/setup-php@v2
+ path: src
+ - name: Prepare server
+ uses: ./src/.github/actions/setup-server
with:
+ server-version: ${{ matrix.server-versions }}
php-version: ${{ matrix.php-versions }}
- tools: phpunit
- extensions: mbstring, iconv, fileinfo, intl, pgsql, pdo_pgsql, zip, gd
- coverage: none
-
- - name: Set up PHPUnit
- working-directory: apps/${{ env.APP_NAME }}
- run: composer i
-
- - name: Set up Nextcloud
- env:
- DB_PORT: 4444
- run: |
- mkdir data
- ./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 password
- ./occ app:enable --force ${{ env.APP_NAME }}
- php -S localhost:8080 &
+ server-path: ${{ env.SERVER_PATH }}
+ db-engine: 'pgsql'
+ db-port: ${{ env.DB_PORT}}
+ db-password: ${{ env.DB_PASSWORD }}
+ db-username: ${{ env.DB_USER }}
+ db-name: ${{ env.DB_NAME }}
- name: PHPUnit
- working-directory: apps/${{ env.APP_NAME }}
+ working-directory: ${{ env.SERVER_PATH }}/apps/${{ env.APP_NAME }}
run: ./vendor/phpunit/phpunit/phpunit -c tests/phpunit.xml
- name: PHPUnit integration
- working-directory: apps/${{ env.APP_NAME }}
+ working-directory: ${{ env.SERVER_PATH }}/apps/${{ env.APP_NAME }}
run: ./vendor/phpunit/phpunit/phpunit -c tests/phpunit.integration.xml
diff --git a/.github/workflows/publish_beta.yml b/.github/workflows/publish_beta.yml
index 19721858..ae14b8be 100644
--- a/.github/workflows/publish_beta.yml
+++ b/.github/workflows/publish_beta.yml
@@ -1,4 +1,4 @@
-name: Pubish beta release
+name: Publish beta release
on:
push:
@@ -8,54 +8,56 @@ on:
jobs:
checkout:
runs-on: ubuntu-latest
- strategy:
- matrix:
- node-versions: [14.x]
- npm-versions: [7]
name: Beta release
steps:
- uses: actions/checkout@v2
-
- - name: Get app version from appinfo/info.xml
- id: appinfo
- uses: mavrosxristoforos/get-xml-info@1.0
- with:
- xml-file: 'appinfo/info.xml'
- xpath: '//info//version'
- - name: Get tag name
- id: gettag
- run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Check correct app version
- if: ${{ format('v{0}', steps.appinfo.outputs.info) != steps.gettag.outputs.VERSION }}
- run: echo App version ${{ format('v{0}', steps.appinfo.outputs.info) }} is not equal to tag name ${{ steps.gettag.outputs.VERSION }} |
- echo Cancelling workflow
- exit 1
+ id: appinfo
+ uses: ./.github/actions/get-polls-version
+
+ - name: Setup node
+ if: success()
+ uses: ./.github/actions/setup-node
- - name: Use node ${{ matrix.node-versions }}
- uses: actions/setup-node@v2
+ - name: Setup composer and PHP
+ if: success()
+ uses: ./.github/actions/setup-composer
with:
- node-version: ${{ matrix.node-versions }}
- - name: Set up npm ${{ matrix.npm-versions }}
- run: npm i -g npm@"${{ matrix.npm-versions }}"
+ mode: production
+ php-tools: composer
+
+ - name: build
+ run: npm run build --if-present
- name: Make appstore package
- run: make appstore
+ if: success()
+ run: make package
- name: rename package
+ if: success()
run: mv build/artifacts/appstore/polls.tar.gz build/artifacts/appstore/polls-${{ steps.appinfo.outputs.info }}.tar.gz
- name: create zip archive from sources
+ if: success()
run: |
pushd build/source
zip -r ../artifacts/appstore/polls-${{ steps.appinfo.outputs.info }}.zip *
popd
- - name: Publish beta release
- uses: softprops/action-gh-release@v1
- with:
- prerelease: true
- draft: true
- generate_release_notes: true
- files: |
- build/artifacts/appstore/polls-${{ steps.appinfo.outputs.info }}.tar.gz
- build/artifacts/appstore/polls-${{ steps.appinfo.outputs.info }}.zip
+ - uses: JasonEtco/create-an-issue@v2
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ id: create-issue
+ run: 'echo Created issue number ${{ steps.create-issue.outputs.number }}'
+ run: 'echo Created ${{ steps.create-issue.outputs.url }}'
+
+ # - name: Publish beta release
+ # if: success()
+ # uses: softprops/action-gh-release@v1
+ # with:
+ # prerelease: true
+ # draft: true
+ # generate_release_notes: true
+ # files: |
+ # build/artifacts/appstore/polls-${{ steps.appinfo.outputs.info }}.tar.gz
+ # build/artifacts/appstore/polls-${{ steps.appinfo.outputs.info }}.zip
diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml
index ff3b78e8..b3987beb 100644
--- a/.github/workflows/static-analysis.yml
+++ b/.github/workflows/static-analysis.yml
@@ -8,25 +8,26 @@ on:
- stable*
jobs:
- static-psalm-analysis:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- ocp-version: [ 'dev-master', 'dev-stable21' ]
- php-versions: ['7.4', '8.0']
+ psalm:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ ocp-version: [ 'dev-master', 'dev-stable21' ]
+ php-versions: ['7.4', '8.0']
- name: psalm php${{ matrix.php-versions}} ${{ matrix.ocp-version }}
- steps:
- - name: Checkout
- uses: actions/checkout@master
- - name: Set up php
- uses: shivammathur/setup-php@master
- with:
- php-version: ${{ matrix.php-versions }}
- coverage: none
- - name: Install dependencies
- run: composer i
- - name: Install dependencies
- run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }}
- - name: Run coding standards check
- run: composer run psalm
+ name: psalm php${{ matrix.php-versions}} ${{ matrix.ocp-version }}
+
+ steps:
+ - uses: actions/checkout@master
+
+ - name: Setup composer and PHP
+ uses: ./.github/actions/setup-composer
+ with:
+ php-version: ${{ matrix.php-versions }}
+ php-tools: composer, psalm
+
+ - name: Install Nextcloud API
+ run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }}
+
+ - name: Run coding standards check
+ run: composer run psalm
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 2bdbc469..9012137c 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -23,7 +23,7 @@
<screenshot>https://raw.githubusercontent.com/nextcloud/polls/master/screenshots/edit-poll.png</screenshot>
<dependencies>
<php min-version="7.4"/>
- <nextcloud min-version="21" max-version="24" />
+ <nextcloud min-version="22" max-version="24" />
</dependencies>
<activity>
<providers>