diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 579a0568af1..334e5531fd7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -224,37 +224,34 @@ jobs: if: inputs.IMPORT timeout-minutes: 45 steps: - - name: run playwright - run: | - # wait until FE stabilizes a bit - sleep 3m - - curl -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" \ - --request POST \ - https://api.github.com/repos/dataquest-dev/\ - dspace-ui-tests/actions/workflows/cron-test.yml/dispatches \ - --data "{\"ref\":\"refs/heads/master\"}" 2> /dev/null - - # wait for it to start - sleep 30s + - name: Checkout Playwright tests + uses: actions/checkout@v4 + with: + repository: dataquest-dev/dspace-ui-tests + path: dspace-ui-tests + token: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }} - # get result of last job - RES=$(curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" https://api.github.com/repos/dataquest-dev/dspace-ui-tests/actions/workflows/cron-test.yml/runs?per_page=1 2> /dev/null | jq .workflow_runs[0].conclusion) + - name: Checkout main repository + uses: actions/checkout@v4 + with: + path: this-repository - # while job did not finish, sleep - while [[ $RES == 'null' ]]; do - sleep 10s - RES=$(curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" https://api.github.com/repos/dataquest-dev/dspace-ui-tests/actions/workflows/cron-test.yml/runs?per_page=1 2> /dev/null | jq .workflow_runs[0].conclusion) - done; + - name: Copy customer config to UI tests repository for merging + run: | + cp this-repository/config/config.lindat.ui.tests.json dspace-ui-tests/customer-constants/ - echo $RES - # if last result is not success, return -1 and fail - if [[ $RES != \"success\" ]]; then + - name: test + working-directory: dspace-ui-tests/scripts + env: + HOME_URL: https://dev-5.pc:8443/repository/ + NAME: LINDAT + run: | + ./test.sh - echo "playwright tests have failed! check appropriate action run in the dspace-ui-tests repository" - exit 1 - fi; + - uses: mazoea/ga-maz/end@master + with: + CHOWN_DIR: ./ + if: ${{ always() }} rest-tests-after-import8: runs-on: ubuntu-latest diff --git a/.github/workflows/playwright-tests.yml b/.github/workflows/playwright-tests.yml new file mode 100644 index 00000000000..4cfe6f64e45 --- /dev/null +++ b/.github/workflows/playwright-tests.yml @@ -0,0 +1,39 @@ +name: Playwright tests + +on: + workflow_dispatch: + workflow_call: + +jobs: + playwright-tests: + runs-on: dspace-test-1 + timeout-minutes: 45 + steps: + - name: Checkout Playwright tests + uses: actions/checkout@v4 + with: + repository: dataquest-dev/dspace-ui-tests + path: dspace-ui-tests + token: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }} + + - name: Checkout main repository + uses: actions/checkout@v4 + with: + path: this-repository + + - name: Copy customer config to UI tests repository for merging + run: | + cp this-repository/config/config.lindat.ui.tests.json dspace-ui-tests/customer-constants/ + + - name: test + working-directory: dspace-ui-tests/scripts + env: + HOME_URL: https://dev-5.pc:8443/repository/ + NAME: LINDAT + run: | + ./test.sh + + - uses: mazoea/ga-maz/end@master + with: + CHOWN_DIR: ./ + if: ${{ always() }} \ No newline at end of file diff --git a/.github/workflows/trigger-ui-tests.yml b/.github/workflows/trigger-ui-tests.yml new file mode 100644 index 00000000000..22dfc03fdf6 --- /dev/null +++ b/.github/workflows/trigger-ui-tests.yml @@ -0,0 +1,30 @@ +name: Trigger UI Tests for All Customer Branches + +on: + workflow_dispatch: + workflow_call: + schedule: + - cron: '0 5 * * *' + +permissions: + actions: write # Grants permission to trigger workflows + contents: read # Access to repository contents + +jobs: + trigger-builds: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get and Trigger Customer Branch UI Tests + run: | + # Authenticate with GitHub CLI using the token + echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token + + git fetch --prune origin + BRANCHES=$(git ls-remote --heads origin | awk -F'/' '{print $3"/"$4}' | grep '^customer/') + for branch in $(echo "$BRANCHES" | sed -e 's/[\[\]"]//g' -e 's/,/\n/g'); do + echo "Triggering UI tests for branch: $branch" + gh workflow run playwright-tests.yml --ref $branch + done \ No newline at end of file diff --git a/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.html b/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.html index 16c57f29ea1..2ea2687c0a7 100644 --- a/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.html +++ b/src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.html @@ -88,8 +88,14 @@