Merge pull request #116 from JankariTech/individual-it-patch-2 #269
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: lint-and-tests | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_call: | |
| env: | |
| OC_URL: https://localhost:9200 | |
| jobs: | |
| lint-and-tests: | |
| strategy: | |
| matrix: | |
| server: | |
| - Ocis | |
| - Opencloud | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: generate-package-json | |
| run: make dependencies${{ matrix.server }} | |
| - name: pnpm-install | |
| uses: pnpm/action-setup@v4 | |
| - name: install | |
| run: make install${{ matrix.server }} | |
| - name: lint | |
| run: pnpm lint | |
| - name: build | |
| run: pnpm build | |
| - name: upload-dist | |
| uses: actions/upload-artifact@v4 | |
| if: github.event_name == 'release' | |
| with: | |
| name: dist-${{ matrix.server }} | |
| path: dist/ | |
| retention-days: 1 | |
| - name: unit-test | |
| run: pnpm test:unit --coverage | |
| - name: ocis-server | |
| if: matrix.server == 'Ocis' | |
| run: | | |
| docker run --rm -d \ | |
| -p 9200:9200 \ | |
| -e OCIS_URL=$OC_URL \ | |
| -e OCIS_INSECURE=true \ | |
| -e OCIS_LOG_LEVEL=error \ | |
| -e IDM_ADMIN_PASSWORD=admin \ | |
| -e PROXY_ENABLE_BASIC_AUTH=true \ | |
| -e PROXY_CSP_CONFIG_FILE_LOCATION=/etc/ocis/csp.yml \ | |
| -e WEB_ASSET_APPS_PATH=/web/apps \ | |
| -v ${{ github.workspace }}/dev/config/csp.yml:/etc/ocis/csp.yml:ro \ | |
| -v ${{ github.workspace }}/dist:/web/apps:ro \ | |
| --entrypoint sh \ | |
| owncloud/ocis-rolling:latest \ | |
| -c 'ocis init || true && ocis server' | |
| - name: opencloud-server | |
| if: matrix.server == 'Opencloud' | |
| run: | | |
| docker run --rm -d \ | |
| -p 9200:9200 \ | |
| -e OC_URL=$OC_URL \ | |
| -e OC_INSECURE=true \ | |
| -e OC_LOG_LEVEL=error \ | |
| -e IDM_ADMIN_PASSWORD=admin \ | |
| -e PROXY_ENABLE_BASIC_AUTH=true \ | |
| -e PROXY_CSP_CONFIG_FILE_LOCATION=/etc/opencloud/csp.yml \ | |
| -e WEB_ASSET_APPS_PATH=/web/apps \ | |
| -v ${{ github.workspace }}/dev/config/csp.yml:/etc/opencloud/csp.yml:ro \ | |
| -v ${{ github.workspace }}/dist:/web/apps:ro \ | |
| --entrypoint sh \ | |
| opencloudeu/opencloud-rolling:latest \ | |
| -c 'opencloud init || true && opencloud server' | |
| - name: host-ip | |
| id: host_ip | |
| run: echo "host_ip=$(hostname -I | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" | |
| - name: wait-services | |
| run: | | |
| docker run --rm \ | |
| --add-host dockerhost:${{ steps.host_ip.outputs.host_ip }} \ | |
| owncloudci/wait-for \ | |
| -it dockerhost:9200 -t 300 | |
| - name: install-chromium | |
| run: npx playwright install chromium | |
| - name: e2e-${{ matrix.server }} | |
| run: pnpm test:e2e tests/e2e/features/**/*.feature | |
| env: | |
| HEADLESS: true | |
| TARGET_SERVER: ${{ matrix.server }} |