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