Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e tests to check oauth workflow #260

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
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
124 changes: 90 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
name: CI
strategy:
matrix:
nextcloudVersion: [ stable22, stable23, stable24, stable25, master ]
phpVersion: [ 7.4, 8.0, 8.1 ]
nextcloudVersion: [stable25 ]
phpVersion: [ 8.1 ]
exclude:
- nextcloudVersion: stable22
phpVersion: 8.1
Expand All @@ -21,6 +21,41 @@ jobs:
- nextcloudVersion: stable24
phpVersion: 8.1
runs-on: ubuntu-latest
# Docker Hub image that `build` executes in
container: ubuntu:latest
services:
openproject:
image: openproject/community:12
env:
OPENPROJECT_SECRET_KEY_BASE: secret
OPENPROJECT_HOST__NAME: openproject
OPENPROJECT_HTTPS: false
OPENPROJECT_PASSWORD__MIN__LENGTH: 0
OPENPROJECT_ONBOARDING__ENABLED: false
OPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_USER: apiadmin
OPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_PASSWORD: apiadmin

proxy:
image: ghcr.io/juliushaertl/nextcloud-dev-nginx:latest
ports:
- "80:80"
- "443:443"
env:
DHPARAM_BITS: 2048
DHPARAM_GENERATION: "false"
HTTPS_METHOD: "noredirect"
HSTS: "off"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro

nextcloud:
image: ghcr.io/juliushaertl/nextcloud-dev-php80:latest
env:
NEXTCLOUD_AUTOINSTALL: "YES"
NEXTCLOUD_AUTOINSTALL_APPS: "viewer, activity"
VIRTUAL_HOST: "nextcloud"
NEXTCLOUD_TRUSTED_DOMAINS: nextcloud

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
Expand Down Expand Up @@ -68,43 +103,64 @@ jobs:
- name: Install PHP Dependencies
run: |
composer install --no-progress --prefer-dist --optimize-autoloader
git clone --depth 1 https://github.com/nextcloud/server.git -b ${{ matrix.nextcloudVersion }}
cd server && git submodule update --init
./occ maintenance:install --admin-pass=admin

- name: PHP stan
run: make phpstan

- name: PHP code style
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
# git clone --depth 1 https://github.com/nextcloud/server.git -b ${{ matrix.nextcloudVersion }}
# cd server && git submodule update --init
# ./occ maintenance:install --admin-pass=admin

# - name: PHP stan
# run: make phpstan
#
# - name: PHP code style
# run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

# - name: Install NPM Dependencies
# run: npm install

# - name: JS Lint
# run: npm run lint
#
# - name: Style Lint
# run: npm run stylelint
#
# - name: PHP & Vue Unit Tests
# run: |
# make phpunit
# make jsunit

# - name: API Tests
# env:
# NEXTCLOUD_BASE_URL: http://localhost:8080
# run: |
# git clone --depth 1 https://github.com/nextcloud/activity.git -b ${{ matrix.nextcloudVersion }} server/apps/activity
# mkdir -p server/apps/integration_openproject
# cp -r `ls -A | grep -v 'server'` server/apps/integration_openproject/
# cd server
# ./occ a:e activity
# ./occ a:e integration_openproject
# php -S localhost:8080 2> /dev/null &
# cd apps/integration_openproject
# make api-test

- name: wait on OpenProject
uses: iFaxity/wait-on-action@v1
with:
resource: http-get://openproject/api/v3/
timeout: 240000

- name: Install NPM Dependencies
run: npm install
- name: wait on Nextcloud
run: until curl -s -f http://nextcloud/status.php | grep '"installed":true'; do echo .; sleep 10; done

- name: JS Lint
run: npm run lint
- name: try OpenProject
run: curl http://openproject/api/v3/users -u apiadmin:apiadmin

- name: Style Lint
run: npm run stylelint
- name: try Nextcloud2
run: curl http://nextcloud/status.php -v || true

- name: PHP & Vue Unit Tests
run: |
make phpunit
make jsunit
- name: try Nextcloud3
run: curl -k https://nextcloud/status.php || true

- name: API Tests
env:
NEXTCLOUD_BASE_URL: http://localhost:8080
run: |
git clone --depth 1 https://github.com/nextcloud/activity.git -b ${{ matrix.nextcloudVersion }} server/apps/activity
mkdir -p server/apps/integration_openproject
cp -r `ls -A | grep -v 'server'` server/apps/integration_openproject/
cd server
./occ a:e activity
./occ a:e integration_openproject
php -S localhost:8080 2> /dev/null &
cd apps/integration_openproject
make api-test
- name: try Nextcloud4
run: curl -k https://proxy/status.php || true

- name: JS Code Coverage Summary Report
if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'master' && matrix.phpVersion == '7.4' }}
Expand Down