|
|
|
|
@ -18,9 +18,16 @@ env:
|
|
|
|
|
# Adjust APP_NAME if your repository name is different
|
|
|
|
|
APP_NAME: ${{ github.event.repository.name }}
|
|
|
|
|
|
|
|
|
|
# Server requires head_ref instead of base_ref, as we want to test the PR branch
|
|
|
|
|
# This represents the server branch to checkout.
|
|
|
|
|
# Usually it's the base branch of the PR, but for pushes it's the branch itself.
|
|
|
|
|
# e.g. 'main', 'stable27' or 'feature/my-feature'
|
|
|
|
|
# n.b. server will use head_ref, as we want to test the PR branch.
|
|
|
|
|
BRANCH: ${{ github.head_ref || github.ref_name }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
init:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
@ -39,8 +46,9 @@ jobs:
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
|
|
- name: Checkout server
|
|
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
|
with:
|
|
|
|
|
persist-credentials: false
|
|
|
|
|
# We need to checkout submodules for 3rdparty
|
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
|
|
@ -62,7 +70,7 @@ jobs:
|
|
|
|
|
fallbackNpm: "^10"
|
|
|
|
|
|
|
|
|
|
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
|
|
|
|
|
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
|
|
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
|
|
|
with:
|
|
|
|
|
node-version: ${{ steps.versions.outputs.nodeVersion }}
|
|
|
|
|
|
|
|
|
|
@ -78,7 +86,7 @@ jobs:
|
|
|
|
|
run: npm run cypress:version
|
|
|
|
|
|
|
|
|
|
- name: Save context
|
|
|
|
|
uses: buildjet/cache/save@e376f15c6ec6dc595375c78633174c7e5f92dc0e # v3
|
|
|
|
|
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
|
|
|
|
|
with:
|
|
|
|
|
key: cypress-context-${{ github.run_id }}
|
|
|
|
|
path: ./
|
|
|
|
|
@ -92,7 +100,7 @@ jobs:
|
|
|
|
|
matrix:
|
|
|
|
|
# Run multiple copies of the current job in parallel
|
|
|
|
|
# Please increase the number or runners as your tests suite grows (0 based index for e2e tests)
|
|
|
|
|
containers: ["component", '0', '1', '2', '3', '4', '5', '6', '7']
|
|
|
|
|
containers: ['component', '0', '1', '2', '3', '4', '5', '6', '7']
|
|
|
|
|
# Hack as strategy.job-total includes the component and GitHub does not allow math expressions
|
|
|
|
|
# Always align this number with the total of e2e runners (max. index + 1)
|
|
|
|
|
total-containers: [8]
|
|
|
|
|
@ -101,14 +109,14 @@ jobs:
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- name: Restore context
|
|
|
|
|
uses: buildjet/cache/restore@e376f15c6ec6dc595375c78633174c7e5f92dc0e # v3
|
|
|
|
|
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
|
|
|
|
|
with:
|
|
|
|
|
fail-on-cache-miss: true
|
|
|
|
|
key: cypress-context-${{ github.run_id }}
|
|
|
|
|
path: ./
|
|
|
|
|
|
|
|
|
|
- name: Set up node ${{ needs.init.outputs.nodeVersion }}
|
|
|
|
|
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
|
|
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
|
|
|
with:
|
|
|
|
|
node-version: ${{ needs.init.outputs.nodeVersion }}
|
|
|
|
|
|
|
|
|
|
@ -116,7 +124,7 @@ jobs:
|
|
|
|
|
run: npm i -g 'npm@${{ needs.init.outputs.npmVersion }}'
|
|
|
|
|
|
|
|
|
|
- name: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests
|
|
|
|
|
uses: cypress-io/github-action@df7484c5ba85def7eef30db301afa688187bc378 # v6.7.2
|
|
|
|
|
uses: cypress-io/github-action@f1f0912d392f0d06bdd01fb9ebe3b3299e5806fb # v6.7.7
|
|
|
|
|
with:
|
|
|
|
|
component: ${{ matrix.containers == 'component' }}
|
|
|
|
|
group: ${{ matrix.use-cypress-cloud && matrix.containers == 'component' && 'Run component' || matrix.use-cypress-cloud && 'Run E2E' || '' }}
|
|
|
|
|
@ -135,8 +143,8 @@ jobs:
|
|
|
|
|
SPLIT: ${{ matrix.total-containers }}
|
|
|
|
|
SPLIT_INDEX: ${{ matrix.containers == 'component' && 0 || matrix.containers }}
|
|
|
|
|
|
|
|
|
|
- name: Upload snapshots
|
|
|
|
|
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
|
|
|
|
- name: Upload snapshots and videos
|
|
|
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
|
|
|
if: always()
|
|
|
|
|
with:
|
|
|
|
|
name: snapshots_videos_${{ matrix.containers }}
|
|
|
|
|
@ -149,7 +157,7 @@ jobs:
|
|
|
|
|
run: docker logs nextcloud-cypress-tests_${{ env.APP_NAME }} > nextcloud.log
|
|
|
|
|
|
|
|
|
|
- name: Upload NC logs
|
|
|
|
|
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
|
|
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
|
|
|
if: failure() && matrix.containers != 'component'
|
|
|
|
|
with:
|
|
|
|
|
name: nc_logs_${{ matrix.containers }}
|
|
|
|
|
@ -160,7 +168,7 @@ jobs:
|
|
|
|
|
run: docker exec nextcloud-cypress-tests_${{ env.APP_NAME }} tar -cvjf - data > data.tar
|
|
|
|
|
|
|
|
|
|
- name: Upload data dir archive
|
|
|
|
|
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
|
|
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
|
|
|
if: failure() && matrix.containers != 'component'
|
|
|
|
|
with:
|
|
|
|
|
name: nc_data_${{ matrix.containers }}
|
|
|
|
|
|