2424 # Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
2525 DSPACE_UI_HOST : 127.0.0.1
2626 DSPACE_UI_PORT : 4000
27+ DSPACE_UI_BASEURL : http://127.0.0.1:4000
2728 # Ensure all SSR caching is disabled in test environment
2829 DSPACE_CACHE_SERVERSIDE_BOTCACHE_MAX : 0
2930 DSPACE_CACHE_SERVERSIDE_ANONYMOUSCACHE_MAX : 0
3940 # Project name to use when running "docker compose" prior to e2e tests
4041 COMPOSE_PROJECT_NAME : ' ci'
4142 # Docker Registry to use for Docker compose scripts below.
42- # We use GitHub's Container Registry to avoid aggressive rate limits at DockerHub.
43- DOCKER_REGISTRY : ghcr.io
43+ # On the upstream dspace/dspace-angular repository we use GitHub's Container Registry
44+ # (ghcr.io) to avoid aggressive rate limits at DockerHub. Forks cannot authenticate
45+ # against ghcr.io/dspace/* with their own GITHUB_TOKEN (and the images there require
46+ # auth), so on forks we fall back to docker.io where the same images are public.
47+ DOCKER_REGISTRY : ${{ github.repository == 'dspace/dspace-angular' && 'ghcr.io' || 'docker.io' }}
4448 strategy :
4549 # Create a matrix of Node versions to test against (in parallel)
4650 matrix :
@@ -51,11 +55,11 @@ jobs:
5155 steps :
5256 # https://github.com/actions/checkout
5357 - name : Checkout codebase
54- uses : actions/checkout@v4
58+ uses : actions/checkout@v6
5559
5660 # https://github.com/actions/setup-node
5761 - name : Install Node.js ${{ matrix.node-version }}
58- uses : actions/setup-node@v4
62+ uses : actions/setup-node@v6
5963 with :
6064 node-version : ${{ matrix.node-version }}
6165
8084 id : yarn-cache-dir-path
8185 run : echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
8286 - name : Cache Yarn dependencies
83- uses : actions/cache@v4
87+ uses : actions/cache@v5
8488 with :
8589 # Cache entire Yarn cache directory (see previous step)
8690 path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -113,16 +117,21 @@ jobs:
113117 # so that it can be shared with the 'codecov' job (see below)
114118 # NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
115119 - name : Upload code coverage report to Artifact
116- uses : actions/upload-artifact@v4
120+ uses : actions/upload-artifact@v7
117121 if : matrix.node-version == '18.x'
118122 with :
119123 name : coverage-report-${{ matrix.node-version }}
120124 path : ' coverage/dspace-angular/lcov.info'
121125 retention-days : 14
122126
123- # Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
127+ # Login to our Docker registry, so that we can access Docker images using "docker compose" below.
128+ # This login is required on the upstream repository because DOCKER_REGISTRY is set to ghcr.io
129+ # and pulling ghcr.io/dspace/* requires authentication. On forks, DOCKER_REGISTRY falls back to
130+ # docker.io (see env block above) where the same images are publicly pullable without a login,
131+ # and forks cannot authenticate against ghcr.io/dspace/* with their own GITHUB_TOKEN anyway.
124132 - name : Login to ${{ env.DOCKER_REGISTRY }}
125- uses : docker/login-action@v3
133+ uses : docker/login-action@v4
134+ if : github.repository == 'dspace/dspace-angular'
126135 with :
127136 registry : ${{ env.DOCKER_REGISTRY }}
128137 username : ${{ github.repository_owner }}
@@ -139,7 +148,7 @@ jobs:
139148 # https://github.com/cypress-io/github-action
140149 # (NOTE: to run these e2e tests locally, just use 'ng e2e')
141150 - name : Run e2e tests (integration tests)
142- uses : cypress-io/github-action@v6
151+ uses : cypress-io/github-action@v7.1.9
143152 with :
144153 # Run tests in Chrome, headless mode (default)
145154 browser : chrome
@@ -154,7 +163,7 @@ jobs:
154163 # Cypress always creates a video of all e2e tests (whether they succeeded or failed)
155164 # Save those in an Artifact
156165 - name : Upload e2e test videos to Artifacts
157- uses : actions/upload-artifact@v4
166+ uses : actions/upload-artifact@v7
158167 if : always()
159168 with :
160169 name : e2e-test-videos-${{ matrix.node-version }}
@@ -163,7 +172,7 @@ jobs:
163172 # If e2e tests fail, Cypress creates a screenshot of what happened
164173 # Save those in an Artifact
165174 - name : Upload e2e test failure screenshots to Artifacts
166- uses : actions/upload-artifact@v4
175+ uses : actions/upload-artifact@v7
167176 if : failure()
168177 with :
169178 name : e2e-test-screenshots-${{ matrix.node-version }}
@@ -306,22 +315,25 @@ jobs:
306315 codecov :
307316 # Must run after 'tests' job above
308317 needs : tests
318+ # Only run on the upstream repository: forks do not have the CODECOV_TOKEN secret,
319+ # and Codecov refuses to create a commit on a protected branch without a token.
320+ if : github.repository == 'dspace/dspace-angular'
309321 runs-on : ubuntu-latest
310322 steps :
311323 - name : Checkout
312- uses : actions/checkout@v4
324+ uses : actions/checkout@v6
313325
314326 # Download artifacts from previous 'tests' job
315327 - name : Download coverage artifacts
316- uses : actions/download-artifact@v4
328+ uses : actions/download-artifact@v8
317329
318330 # Now attempt upload to Codecov using its action.
319331 # NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
320332 #
321333 # Retry action: https://github.com/marketplace/actions/retry-action
322334 # Codecov action: https://github.com/codecov/codecov-action
323335 - name : Upload coverage to Codecov.io
324- uses : Wandalen/wretry.action@v1.3 .0
336+ uses : Wandalen/wretry.action@v3.8 .0
325337 with :
326338 action : codecov/codecov-action@v4
327339 # Ensure codecov-action throws an error when it fails to upload
0 commit comments