Skip to content

Commit fb98f44

Browse files
Merge pull request #16 from CICBA/merge-dspace7.6.3
Merge 7.6.3
2 parents 03e64b3 + 368ce8b commit fb98f44

855 files changed

Lines changed: 37652 additions & 17841 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ name: Build
77
on: [push, pull_request]
88

99
permissions:
10-
contents: read # to fetch code (actions/checkout)
10+
contents: read # to fetch code (actions/checkout)
11+
packages: read # to fetch private images from GitHub Container Registry (GHCR)
1112

1213
jobs:
1314
tests:
@@ -33,21 +34,26 @@ jobs:
3334
#CHROME_VERSION: "90.0.4430.212-1"
3435
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
3536
NODE_OPTIONS: '--max-old-space-size=4096'
37+
# Project name to use when running "docker compose" prior to e2e tests
38+
COMPOSE_PROJECT_NAME: 'ci'
39+
# Docker Registry to use for Docker compose scripts below.
40+
# We use GitHub's Container Registry to avoid aggressive rate limits at DockerHub.
41+
DOCKER_REGISTRY: ghcr.io
3642
strategy:
3743
# Create a matrix of Node versions to test against (in parallel)
3844
matrix:
39-
node-version: [16.x, 18.x]
45+
node-version: [18.x, 20.x]
4046
# Do NOT exit immediately if one matrix job fails
4147
fail-fast: false
4248
# These are the actual CI steps to perform per job
4349
steps:
4450
# https://github.com/actions/checkout
4551
- name: Checkout codebase
46-
uses: actions/checkout@v3
52+
uses: actions/checkout@v4
4753

4854
# https://github.com/actions/setup-node
4955
- name: Install Node.js ${{ matrix.node-version }}
50-
uses: actions/setup-node@v3
56+
uses: actions/setup-node@v4
5157
with:
5258
node-version: ${{ matrix.node-version }}
5359

@@ -72,7 +78,7 @@ jobs:
7278
id: yarn-cache-dir-path
7379
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
7480
- name: Cache Yarn dependencies
75-
uses: actions/cache@v3
81+
uses: actions/cache@v4
7682
with:
7783
# Cache entire Yarn cache directory (see previous step)
7884
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -99,26 +105,34 @@ jobs:
99105
# so that it can be shared with the 'codecov' job (see below)
100106
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
101107
- name: Upload code coverage report to Artifact
102-
uses: actions/upload-artifact@v3
108+
uses: actions/upload-artifact@v4
103109
if: matrix.node-version == '18.x'
104110
with:
105-
name: dspace-angular coverage report
111+
name: coverage-report-${{ matrix.node-version }}
106112
path: 'coverage/dspace-angular/lcov.info'
107113
retention-days: 14
108114

109-
# Using docker-compose start backend using CI configuration
115+
# Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
116+
- name: Login to ${{ env.DOCKER_REGISTRY }}
117+
uses: docker/login-action@v3
118+
with:
119+
registry: ${{ env.DOCKER_REGISTRY }}
120+
username: ${{ github.repository_owner }}
121+
password: ${{ secrets.GITHUB_TOKEN }}
122+
123+
# Using "docker compose" start backend using CI configuration
110124
# and load assetstore from a cached copy
111125
- name: Start DSpace REST Backend via Docker (for e2e tests)
112126
run: |
113-
docker-compose -f ./docker/docker-compose-ci.yml up -d
114-
docker-compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
127+
docker compose -f ./docker/docker-compose-ci.yml up -d
128+
docker compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
115129
docker container ls
116130
117131
# Run integration tests via Cypress.io
118132
# https://github.com/cypress-io/github-action
119133
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
120134
- name: Run e2e tests (integration tests)
121-
uses: cypress-io/github-action@v5
135+
uses: cypress-io/github-action@v6
122136
with:
123137
# Run tests in Chrome, headless mode (default)
124138
browser: chrome
@@ -133,19 +147,19 @@ jobs:
133147
# Cypress always creates a video of all e2e tests (whether they succeeded or failed)
134148
# Save those in an Artifact
135149
- name: Upload e2e test videos to Artifacts
136-
uses: actions/upload-artifact@v3
150+
uses: actions/upload-artifact@v4
137151
if: always()
138152
with:
139-
name: e2e-test-videos
153+
name: e2e-test-videos-${{ matrix.node-version }}
140154
path: cypress/videos
141155

142156
# If e2e tests fail, Cypress creates a screenshot of what happened
143157
# Save those in an Artifact
144158
- name: Upload e2e test failure screenshots to Artifacts
145-
uses: actions/upload-artifact@v3
159+
uses: actions/upload-artifact@v4
146160
if: failure()
147161
with:
148-
name: e2e-test-screenshots
162+
name: e2e-test-screenshots-${{ matrix.node-version }}
149163
path: cypress/screenshots
150164

151165
- name: Stop app (in case it stays up after e2e tests)
@@ -180,7 +194,7 @@ jobs:
180194
run: kill -9 $(lsof -t -i:4000)
181195

182196
- name: Shutdown Docker containers
183-
run: docker-compose -f ./docker/docker-compose-ci.yml down
197+
run: docker compose -f ./docker/docker-compose-ci.yml down
184198

185199
# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
186200
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
@@ -191,22 +205,27 @@ jobs:
191205
runs-on: ubuntu-latest
192206
steps:
193207
- name: Checkout
194-
uses: actions/checkout@v3
208+
uses: actions/checkout@v4
195209

196210
# Download artifacts from previous 'tests' job
197211
- name: Download coverage artifacts
198-
uses: actions/download-artifact@v3
212+
uses: actions/download-artifact@v4
199213

200214
# Now attempt upload to Codecov using its action.
201215
# NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
202216
#
203217
# Retry action: https://github.com/marketplace/actions/retry-action
204218
# Codecov action: https://github.com/codecov/codecov-action
205219
- name: Upload coverage to Codecov.io
206-
uses: Wandalen/wretry.action@v1.0.36
220+
uses: Wandalen/wretry.action@v1.3.0
207221
with:
208-
action: codecov/codecov-action@v3
209-
# Try upload 5 times max
222+
action: codecov/codecov-action@v4
223+
# Ensure codecov-action throws an error when it fails to upload
224+
# This allows us to auto-restart the action if an error is thrown
225+
with: |
226+
fail_ci_if_error: true
227+
token: ${{ secrets.CODECOV_TOKEN }}
228+
# Try re-running action 5 times max
210229
attempt_limit: 5
211230
# Run again in 30 seconds
212231
attempt_delay: 30000

.github/workflows/codescan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
steps:
3636
# https://github.com/actions/checkout
3737
- name: Checkout repository
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3939

4040
# Initializes the CodeQL tools for scanning.
4141
# https://github.com/github/codeql-action

.github/workflows/docker.yml

Lines changed: 32 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Docker images
33

44
# Run this Build for all pushes to 'main' or maintenance branches, or tagged releases.
55
# Also run for PRs to ensure PR doesn't break Docker build process
6+
# NOTE: uses "reusable-docker-build.yml" in DSpace/DSpace to actually build each of the Docker images
7+
# https://github.com/DSpace/DSpace/blob/dspace-7_x/.github/workflows/reusable-docker-build.yml
8+
#
69
on:
710
push:
811
branches:
@@ -13,142 +16,45 @@ on:
1316
pull_request:
1417

1518
permissions:
16-
contents: read # to fetch code (actions/checkout)
17-
18-
19-
env:
20-
# Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action)
21-
# For a new commit on default branch (main), use the literal tag 'latest' on Docker image.
22-
# For a new commit on other branches, use the branch name as the tag for Docker image.
23-
# For a new tag, copy that tag name as the tag for Docker image.
24-
IMAGE_TAGS: |
25-
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
26-
type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
27-
type=ref,event=tag
28-
# Define default tag "flavor" for docker/metadata-action per
29-
# https://github.com/docker/metadata-action#flavor-input
30-
# We manage the 'latest' tag ourselves to the 'main' branch (see settings above)
31-
TAGS_FLAVOR: |
32-
latest=false
33-
# Architectures / Platforms for which we will build Docker images
34-
# If this is a PR, we ONLY build for AMD64. For PRs we only do a sanity check test to ensure Docker builds work.
35-
# If this is NOT a PR (e.g. a tag or merge commit), also build for ARM64.
36-
PLATFORMS: linux/amd64${{ github.event_name != 'pull_request' && ', linux/arm64' || '' }}
37-
19+
contents: read # to fetch code (actions/checkout)
20+
packages: write # to write images to GitHub Container Registry (GHCR)
3821

3922
jobs:
40-
###############################################
23+
#############################################################
4124
# Build/Push the 'dspace/dspace-angular' image
42-
###############################################
25+
#############################################################
4326
dspace-angular:
4427
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
4528
if: github.repository == 'dspace/dspace-angular'
46-
runs-on: ubuntu-latest
47-
48-
steps:
49-
# https://github.com/actions/checkout
50-
- name: Checkout codebase
51-
uses: actions/checkout@v3
52-
53-
# https://github.com/docker/setup-buildx-action
54-
- name: Setup Docker Buildx
55-
uses: docker/setup-buildx-action@v2
56-
57-
# https://github.com/docker/setup-qemu-action
58-
- name: Set up QEMU emulation to build for multiple architectures
59-
uses: docker/setup-qemu-action@v2
60-
61-
# https://github.com/docker/setup-qemu-action
62-
- name: Set up QEMU emulation to build for multiple architectures
63-
uses: docker/setup-qemu-action@v2
64-
65-
# https://github.com/docker/login-action
66-
- name: Login to DockerHub
67-
# Only login if not a PR, as PRs only trigger a Docker build and not a push
68-
if: github.event_name != 'pull_request'
69-
uses: docker/login-action@v2
70-
with:
71-
username: ${{ secrets.DOCKER_USERNAME }}
72-
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
73-
74-
# https://github.com/docker/metadata-action
75-
# Get Metadata for docker_build step below
76-
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular' image
77-
id: meta_build
78-
uses: docker/metadata-action@v4
79-
with:
80-
images: dspace/dspace-angular
81-
tags: ${{ env.IMAGE_TAGS }}
82-
flavor: ${{ env.TAGS_FLAVOR }}
83-
84-
# https://github.com/docker/build-push-action
85-
- name: Build and push 'dspace-angular' image
86-
id: docker_build
87-
uses: docker/build-push-action@v4
88-
with:
89-
context: .
90-
file: ./Dockerfile
91-
platforms: ${{ env.PLATFORMS }}
92-
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
93-
# but we ONLY do an image push to DockerHub if it's NOT a PR
94-
push: ${{ github.event_name != 'pull_request' }}
95-
# Use tags / labels provided by 'docker/metadata-action' above
96-
tags: ${{ steps.meta_build.outputs.tags }}
97-
labels: ${{ steps.meta_build.outputs.labels }}
29+
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
30+
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@dspace-7_x
31+
with:
32+
build_id: dspace-angular-dev
33+
image_name: dspace/dspace-angular
34+
dockerfile_path: ./Dockerfile
35+
secrets:
36+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
37+
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
9838

9939
#############################################################
10040
# Build/Push the 'dspace/dspace-angular' image ('-dist' tag)
10141
#############################################################
10242
dspace-angular-dist:
10343
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
10444
if: github.repository == 'dspace/dspace-angular'
105-
runs-on: ubuntu-latest
106-
107-
steps:
108-
# https://github.com/actions/checkout
109-
- name: Checkout codebase
110-
uses: actions/checkout@v3
111-
112-
# https://github.com/docker/setup-buildx-action
113-
- name: Setup Docker Buildx
114-
uses: docker/setup-buildx-action@v2
115-
116-
# https://github.com/docker/setup-qemu-action
117-
- name: Set up QEMU emulation to build for multiple architectures
118-
uses: docker/setup-qemu-action@v2
119-
120-
# https://github.com/docker/login-action
121-
- name: Login to DockerHub
122-
# Only login if not a PR, as PRs only trigger a Docker build and not a push
123-
if: github.event_name != 'pull_request'
124-
uses: docker/login-action@v2
125-
with:
126-
username: ${{ secrets.DOCKER_USERNAME }}
127-
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
128-
129-
# https://github.com/docker/metadata-action
130-
# Get Metadata for docker_build_dist step below
131-
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular-dist' image
132-
id: meta_build_dist
133-
uses: docker/metadata-action@v4
134-
with:
135-
images: dspace/dspace-angular
136-
tags: ${{ env.IMAGE_TAGS }}
137-
# As this is a "dist" image, its tags are all suffixed with "-dist". Otherwise, it uses the same
138-
# tagging logic as the primary 'dspace/dspace-angular' image above.
139-
flavor: ${{ env.TAGS_FLAVOR }}
140-
suffix=-dist
141-
142-
- name: Build and push 'dspace-angular-dist' image
143-
id: docker_build_dist
144-
uses: docker/build-push-action@v4
145-
with:
146-
context: .
147-
file: ./Dockerfile.dist
148-
platforms: ${{ env.PLATFORMS }}
149-
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
150-
# but we ONLY do an image push to DockerHub if it's NOT a PR
151-
push: ${{ github.event_name != 'pull_request' }}
152-
# Use tags / labels provided by 'docker/metadata-action' above
153-
tags: ${{ steps.meta_build_dist.outputs.tags }}
154-
labels: ${{ steps.meta_build_dist.outputs.labels }}
45+
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
46+
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@dspace-7_x
47+
with:
48+
build_id: dspace-angular-dist
49+
image_name: dspace/dspace-angular
50+
dockerfile_path: ./Dockerfile.dist
51+
# As this is a "dist" image, its tags are all suffixed with "-dist". Otherwise, it uses the same
52+
# tagging logic as the primary 'dspace/dspace-angular' image above.
53+
tags_flavor: suffix=-dist
54+
secrets:
55+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
56+
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
57+
# Enable redeploy of sandbox & demo if the branch for this image matches the deployment branch of
58+
# these sites as specified in reusable-docker-build.xml
59+
REDEPLOY_SANDBOX_URL: ${{ secrets.REDEPLOY_SANDBOX_URL }}
60+
REDEPLOY_DEMO_URL: ${{ secrets.REDEPLOY_DEMO_URL }}

.github/workflows/issue_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# Only add to project board if issue is flagged as "needs triage" or has no labels
1717
# NOTE: By default we flag new issues as "needs triage" in our issue template
1818
if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '')
19-
uses: actions/add-to-project@v0.5.0
19+
uses: actions/add-to-project@v1.0.0
2020
# Note, the authentication token below is an ORG level Secret.
2121
# It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions
2222
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token

.github/workflows/port_merged_pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
if: github.event.pull_request.merged
2424
steps:
2525
# Checkout code
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
# Port PR to other branch (ONLY if labeled with "port to")
2828
# See https://github.com/korthout/backport-action
2929
- name: Create backport pull requests
30-
uses: korthout/backport-action@v1
30+
uses: korthout/backport-action@v2
3131
with:
3232
# Trigger based on a "port to [branch]" label on PR
3333
# (This label must specify the branch name to port to)

.github/workflows/pull_request_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
# Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
2222
# See https://github.com/toshimaru/auto-author-assign
2323
- name: Assign PR to creator
24-
uses: toshimaru/auto-author-assign@v1.6.2
24+
uses: toshimaru/auto-author-assign@v2.1.0

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This image will be published as dspace/dspace-angular
22
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
33

4-
FROM node:18-alpine
4+
FROM docker.io/node:18-alpine
55

66
# Ensure Python and other build tools are available
77
# These are needed to install some node modules, especially on linux/arm64
@@ -24,5 +24,5 @@ ENV NODE_OPTIONS="--max_old_space_size=4096"
2424
# Listen / accept connections from all IP addresses.
2525
# NOTE: At this time it is only possible to run Docker container in Production mode
2626
# if you have a public URL. See https://github.com/DSpace/dspace-angular/issues/1485
27-
ENV NODE_ENV development
27+
ENV NODE_ENV=development
2828
CMD yarn serve --host 0.0.0.0

0 commit comments

Comments
 (0)