diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/api-integration-tests.yml | 25 | ||||
-rw-r--r-- | .github/workflows/api-php-static-code-check.yml | 12 | ||||
-rw-r--r-- | .github/workflows/api-php-tests.yml | 13 | ||||
-rw-r--r-- | .github/workflows/build-release.yml | 12 | ||||
-rw-r--r-- | .github/workflows/documentation.yml | 2 | ||||
-rw-r--r-- | .github/workflows/frontend-nodejs-tests.yml | 4 | ||||
-rw-r--r-- | .github/workflows/lint-eslint.yml | 8 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 52 | ||||
-rw-r--r-- | .github/workflows/post-merge-tasks.yml | 14 | ||||
-rw-r--r-- | .github/workflows/updater-test.yml | 80 |
10 files changed, 178 insertions, 44 deletions
diff --git a/.github/workflows/api-integration-tests.yml b/.github/workflows/api-integration-tests.yml index 484bf38b3..0ab974e2a 100644 --- a/.github/workflows/api-integration-tests.yml +++ b/.github/workflows/api-integration-tests.yml @@ -28,26 +28,22 @@ jobs: - 5432:5432 # Maps tcp port 5432 on service container to the host strategy: matrix: - php-versions: ['7.4', '8.0'] - nextcloud: ['stable23', 'stable24', 'stable25'] + php-versions: ['8.0', '8.1'] + nextcloud: ['stable27'] database: ['sqlite', 'pgsql', 'mysql'] experimental: [false] include: - - php-versions: '8.0' + - php-versions: 8.1 nextcloud: pre-release database: sqlite experimental: true - - php-versions: '8.2' + - php-versions: 8.2 nextcloud: pre-release database: sqlite experimental: true - - php-versions: 8.1 - nextcloud: stable25 - database: sqlite - experimental: false steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive @@ -57,6 +53,8 @@ jobs: php-version: ${{ matrix.php-versions }} extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip coverage: none + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Setup BATS & httpie run: sudo apt-get install -y httpie && npm install -g bats@1.7.0 @@ -101,7 +99,7 @@ jobs: database-password: ${{ env.POSTGRES_PASSWORD }} - name: Prime app build - run: make + run: make composer - name: Configure server with app uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main @@ -119,16 +117,13 @@ jobs: sleep 2 cd ${{ github.workspace }}/../server - + bats apps/news/tests/api # Kill php server kill %1 kill %2 - - name: Setup problem matchers for PHP - run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - name: Functional tests maintenance working-directory: ../server run: | @@ -142,7 +137,7 @@ jobs: sleep 2 cd ${{ github.workspace }}/../server - + bats apps/news/tests/command kill %1 diff --git a/.github/workflows/api-php-static-code-check.yml b/.github/workflows/api-php-static-code-check.yml index 57776f400..9a37fc40c 100644 --- a/.github/workflows/api-php-static-code-check.yml +++ b/.github/workflows/api-php-static-code-check.yml @@ -7,24 +7,26 @@ jobs: continue-on-error: true strategy: matrix: - php-versions: [ '7.4', '8.0', '8.1' ] - nextcloud: [ 'stable25' ] + php-versions: ['8.0', '8.1', '8.2' ] + nextcloud: [ 'stable27' ] database: [ 'sqlite' ] include: - - php-versions: '8.2' + - php-versions: 8.2 nextcloud: pre-release database: sqlite experimental: true name: "phpstan: Nextcloud ${{ matrix.nextcloud }} with ${{ matrix.php-versions }}" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up php uses: shivammathur/setup-php@master with: php-version: ${{ matrix.php-versions }} extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip coverage: none + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set up server non MySQL uses: SMillerDev/nextcloud-actions/setup-nextcloud@main @@ -34,7 +36,7 @@ jobs: database-type: ${{ matrix.database }} - name: Build app - run: make + run: make composer - name: Configure server with app uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main diff --git a/.github/workflows/api-php-tests.yml b/.github/workflows/api-php-tests.yml index 0a2635316..2fb790770 100644 --- a/.github/workflows/api-php-tests.yml +++ b/.github/workflows/api-php-tests.yml @@ -10,19 +10,19 @@ jobs: strategy: matrix: php-versions: ['8.1'] - nextcloud: ['stable25'] + nextcloud: ['stable27'] database: ['sqlite'] experimental: [false] codecoverage: [false] include: - - php-versions: 8.0 - nextcloud: stable24 + - php-versions: 8.2 + nextcloud: stable27 database: sqlite experimental: false codecoverage: true steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 # https://github.com/codecov/codecov-action/issues/190#issuecomment-790729633 @@ -32,6 +32,8 @@ jobs: php-version: ${{ matrix.php-versions }} extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip coverage: pcov + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ### Back to normal setup - name: Set up server non MySQL @@ -50,9 +52,6 @@ jobs: app: 'news' check-code: false - - name: Setup problem matchers for PHPUnit - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Prep PHP tests working-directory: ../server/apps/news run: make php-test-dependencies diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 06b1f4c3d..c8f5a988a 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -15,21 +15,21 @@ jobs: strategy: matrix: php-versions: ['8.1'] - nextcloud: ['stable25'] + nextcloud: ['stable27'] database: ['sqlite'] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP - uses: shivammathur/setup-php@afefcaf556d98dc7896cca380e181decb609ca44 + uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 #2.26.0 with: php-version: ${{ matrix.php-versions }} extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip coverage: none - name: Set up server non MySQL - uses: SMillerDev/nextcloud-actions/setup-nextcloud@fae87e29aa7cdf1ea0b8033c67f60e75b10be2cd + uses: SMillerDev/nextcloud-actions/setup-nextcloud@1e38cb369e2193642279c64ee140fc93ddd4fa77 with: cron: false version: ${{ matrix.nextcloud }} @@ -39,7 +39,7 @@ jobs: run: make - name: Configure server with app - uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@fae87e29aa7cdf1ea0b8033c67f60e75b10be2cd + uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@1e38cb369e2193642279c64ee140fc93ddd4fa77 with: app: ${{ env.APP_NAME }} check-code: false @@ -52,7 +52,7 @@ jobs: app_public_crt: ${{ secrets.APP_PUBLIC_CRT }} - name: Upload app tarball to release - uses: svenstaro/upload-release-action@133984371c30d34e38222a64855679a414cb7575 + uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd id: attach_to_release with: repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9b7022748..ddf60315f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout master - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master diff --git a/.github/workflows/frontend-nodejs-tests.yml b/.github/workflows/frontend-nodejs-tests.yml index d78409ae4..6b0cbbed9 100644 --- a/.github/workflows/frontend-nodejs-tests.yml +++ b/.github/workflows/frontend-nodejs-tests.yml @@ -10,12 +10,12 @@ jobs: strategy: matrix: php-versions: ['8.1'] - nextcloud: ['stable24'] + nextcloud: ['stable27'] database: ['sqlite'] experimental: [false] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml index c08763ea9..2fd40e8dd 100644 --- a/.github/workflows/lint-eslint.yml +++ b/.github/workflows/lint-eslint.yml @@ -22,17 +22,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@v1.2 + uses: skjnldsv/read-package-engines-version-actions@v3 id: versions with: - fallbackNode: '^12' + fallbackNode: '^16' fallbackNpm: '^6' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..fd3a5bf8d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,52 @@ +name: Lint + +on: + pull_request: + push: + branches: + - master + +jobs: + eslint: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + name: eslint node${{ matrix.node-versions }} + steps: + - uses: actions/checkout@v4 + + - name: Set up node ${{ matrix.node-versions }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-versions }} + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + stylelint: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + name: stylelint node${{ matrix.node-versions }} + steps: + - uses: actions/checkout@v4 + + - name: Set up node ${{ matrix.node-versions }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-versions }} + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run stylelint diff --git a/.github/workflows/post-merge-tasks.yml b/.github/workflows/post-merge-tasks.yml index 6385657d3..58859acec 100644 --- a/.github/workflows/post-merge-tasks.yml +++ b/.github/workflows/post-merge-tasks.yml @@ -7,18 +7,20 @@ jobs: php: runs-on: ubuntu-latest continue-on-error: false - name: "Coverage: Nextcloud PHP ${{ matrix.php-versions }}" + name: "Coverage: Nextcloud ${{ matrix.nextcloud }} PHP ${{ matrix.php-version }}" strategy: matrix: - nextcloud: ['stable25'] + nextcloud: ['stable27'] + codecoverage: [true] + php-version: ["8.1"] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: ${{ matrix.php-version }} ### Back to normal setup - name: Set up server non MySQL @@ -39,7 +41,11 @@ jobs: - name: Prep PHP tests run: cd ../server/apps/news && make php-test-dependencies + - name: Unittests run: cd ../server/apps/news && make unit-test + env: + CODECOVERAGE: ${{ matrix.codecoverage }} + - name: Upload codecoverage run: cd ../server/apps/news && bash <(curl -s https://codecov.io/bash) -f build/php-unit.clover diff --git a/.github/workflows/updater-test.yml b/.github/workflows/updater-test.yml new file mode 100644 index 000000000..3f9b217ee --- /dev/null +++ b/.github/workflows/updater-test.yml @@ -0,0 +1,80 @@ +name: Updater Tests +on: + pull_request + +env: + POSTGRES_PASSWORD: nc_test_db + MYSQL_USER: nc_test + MYSQL_PASSWORD: nc_test_db + MYSQL_DATABASE: nc_test + MYSQL_PORT: 3800 + +jobs: + integration: + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} + name: "Update Test: Nextcloud ${{ matrix.nextcloud }} - PHP ${{ matrix.php-versions }}" + strategy: + matrix: + php-versions: ['8.1'] + nextcloud: ['stable27'] + database: ['sqlite'] + experimental: [false] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip + coverage: none + + - name: Setup BATS & httpie + run: sudo apt-get install -y httpie && npm install -g bats@1.7.0 + + - name: Set up server + uses: SMillerDev/nextcloud-actions/setup-nextcloud@main + with: + version: ${{ matrix.nextcloud }} + cron: true + database-type: ${{ matrix.database }} + database-host: localhost + database-port: 5432 + database-name: postgres + database-user: postgres + database-password: ${{ env.POSTGRES_PASSWORD }} + + - name: Prime app build + run: make + + - name: Configure server with app + uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main + with: + app: 'news' + check-code: false + force: ${{ matrix.experimental }} + + - name: Install composer install php-feed-generator + working-directory: ../server + run: composer install -d apps/news/tests/test_helper/php-feed-generator + + - name: Run Updater tests + working-directory: ../server + run: | + php -S localhost:8080 &> /tmp/webserver.log & + cd apps/news/tests/test_helper/feeds && php -S localhost:8090 &> /tmp/feedserver.log & + + sleep 2 + + cd ${{ github.workspace }}/../server + + bats apps/news/tests/updater + + # Kill php server + kill %1 + kill %2 + |