From 923f986e67413ac548cc98d6d59fa01de9681035 Mon Sep 17 00:00:00 2001 From: Devlin Junker Date: Sat, 5 Aug 2023 19:16:39 -0700 Subject: upmerged from master Signed-off-by: Devlin Junker --- .github/workflows/api-integration-tests.yml | 17 +++--- .github/workflows/api-php-static-code-check.yml | 10 +++- .github/workflows/api-php-tests.yml | 7 +-- .github/workflows/build-release.yml | 8 +-- .github/workflows/frontend-nodejs-tests.yml | 4 +- .github/workflows/lint-eslint.yml | 4 +- .github/workflows/post-merge-tasks.yml | 2 +- .github/workflows/updater-test.yml | 80 +++++++++++++++++++++++++ 8 files changed, 107 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/updater-test.yml (limited to '.github/workflows') diff --git a/.github/workflows/api-integration-tests.yml b/.github/workflows/api-integration-tests.yml index 484bf38b3..16ea84198 100644 --- a/.github/workflows/api-integration-tests.yml +++ b/.github/workflows/api-integration-tests.yml @@ -28,23 +28,27 @@ 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: ['stable25', 'stable26', '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 + - php-versions: 7.4 nextcloud: stable25 database: sqlite experimental: false + - php-versions: 8.2 + nextcloud: stable26 + database: sqlite + experimental: false steps: - name: Checkout uses: actions/checkout@v3 @@ -126,9 +130,6 @@ jobs: 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: | diff --git a/.github/workflows/api-php-static-code-check.yml b/.github/workflows/api-php-static-code-check.yml index 57776f400..4afd9eaf1 100644 --- a/.github/workflows/api-php-static-code-check.yml +++ b/.github/workflows/api-php-static-code-check.yml @@ -7,14 +7,18 @@ 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 + - php-versions: 7.4 + nextcloud: stable25 + database: sqlite + experimental: false name: "phpstan: Nextcloud ${{ matrix.nextcloud }} with ${{ matrix.php-versions }}" steps: - name: Checkout diff --git a/.github/workflows/api-php-tests.yml b/.github/workflows/api-php-tests.yml index 0a2635316..dae893f22 100644 --- a/.github/workflows/api-php-tests.yml +++ b/.github/workflows/api-php-tests.yml @@ -10,13 +10,13 @@ jobs: strategy: matrix: php-versions: ['8.1'] - nextcloud: ['stable25'] + nextcloud: ['stable26', 'stable27'] database: ['sqlite'] experimental: [false] codecoverage: [false] include: - php-versions: 8.0 - nextcloud: stable24 + nextcloud: stable25 database: sqlite experimental: false codecoverage: true @@ -50,9 +50,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..636235de0 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: php-versions: ['8.1'] - nextcloud: ['stable25'] + nextcloud: ['stable27'] database: ['sqlite'] steps: - name: Checkout @@ -29,7 +29,7 @@ jobs: coverage: none - name: Set up server non MySQL - uses: SMillerDev/nextcloud-actions/setup-nextcloud@fae87e29aa7cdf1ea0b8033c67f60e75b10be2cd + uses: SMillerDev/nextcloud-actions/setup-nextcloud@main 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@main 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@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 id: attach_to_release with: repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/frontend-nodejs-tests.yml b/.github/workflows/frontend-nodejs-tests.yml index d78409ae4..e077e7d1b 100644 --- a/.github/workflows/frontend-nodejs-tests.yml +++ b/.github/workflows/frontend-nodejs-tests.yml @@ -4,13 +4,13 @@ on: jobs: php: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 continue-on-error: ${{ matrix.experimental }} name: "Frontend: Nextcloud ${{ matrix.nextcloud }} - PHP ${{ matrix.php-versions }} - DB ${{ matrix.database }}" strategy: matrix: php-versions: ['8.1'] - nextcloud: ['stable24'] + nextcloud: ['stable27'] database: ['sqlite'] experimental: [false] steps: diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml index c08763ea9..ec439166b 100644 --- a/.github/workflows/lint-eslint.yml +++ b/.github/workflows/lint-eslint.yml @@ -25,10 +25,10 @@ jobs: uses: actions/checkout@v3 - 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@v2.2 id: versions with: - fallbackNode: '^12' + fallbackNode: '^16' fallbackNpm: '^6' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/post-merge-tasks.yml b/.github/workflows/post-merge-tasks.yml index 6385657d3..ea446f0ce 100644 --- a/.github/workflows/post-merge-tasks.yml +++ b/.github/workflows/post-merge-tasks.yml @@ -10,7 +10,7 @@ jobs: name: "Coverage: Nextcloud PHP ${{ matrix.php-versions }}" strategy: matrix: - nextcloud: ['stable25'] + nextcloud: ['stable27'] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/updater-test.yml b/.github/workflows/updater-test.yml new file mode 100644 index 000000000..eb5901a51 --- /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@v3 + 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 + -- cgit v1.2.3