Skip to content

Commit 051bb4a

Browse files
committed
Merged dspace-cris-2023_02_x into task/dspace-cris-2023_02_x/DSC-1669-2
2 parents d9913f2 + 8f7eb39 commit 051bb4a

File tree

773 files changed

+28142
-17157
lines changed

Some content is hidden

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

773 files changed

+28142
-17157
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
CHROME_VERSION: "116.0.5845.187-1"
3434
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
3535
NODE_OPTIONS: '--max-old-space-size=4096'
36+
# Project name to use when running "docker compose" prior to e2e tests
37+
COMPOSE_PROJECT_NAME: 'ci'
3638
strategy:
3739
# Create a matrix of Node versions to test against (in parallel)
3840
matrix:
@@ -43,11 +45,11 @@ jobs:
4345
steps:
4446
# https://github.com/actions/checkout
4547
- name: Checkout codebase
46-
uses: actions/checkout@v3
48+
uses: actions/checkout@v4
4749

4850
# https://github.com/actions/setup-node
4951
- name: Install Node.js ${{ matrix.node-version }}
50-
uses: actions/setup-node@v3
52+
uses: actions/setup-node@v4
5153
with:
5254
node-version: ${{ matrix.node-version }}
5355

@@ -72,7 +74,7 @@ jobs:
7274
id: yarn-cache-dir-path
7375
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
7476
- name: Cache Yarn dependencies
75-
uses: actions/cache@v3
77+
uses: actions/cache@v4
7678
with:
7779
# Cache entire Yarn cache directory (see previous step)
7880
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -99,26 +101,26 @@ jobs:
99101
# so that it can be shared with the 'codecov' job (see below)
100102
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
101103
- name: Upload code coverage report to Artifact
102-
uses: actions/upload-artifact@v3
104+
uses: actions/upload-artifact@v4
103105
if: matrix.node-version == '18.x'
104106
with:
105-
name: dspace-angular coverage report
107+
name: coverage-report-${{ matrix.node-version }}
106108
path: 'coverage/dspace-angular/lcov.info'
107109
retention-days: 14
108110

109-
# Using docker-compose start backend using CI configuration
111+
# Using "docker compose" start backend using CI configuration
110112
# and load assetstore from a cached copy
111113
- name: Start DSpace REST Backend via Docker (for e2e tests)
112114
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
115+
docker compose -f ./docker/docker-compose-ci.yml up -d
116+
docker compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
115117
docker container ls
116118
117119
# Run integration tests via Cypress.io
118120
# https://github.com/cypress-io/github-action
119121
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
120122
- name: Run e2e tests (integration tests)
121-
uses: cypress-io/github-action@v5
123+
uses: cypress-io/github-action@v6
122124
with:
123125
# Run tests in Chrome, headless mode (default)
124126
browser: chrome
@@ -133,19 +135,19 @@ jobs:
133135
# Cypress always creates a video of all e2e tests (whether they succeeded or failed)
134136
# Save those in an Artifact
135137
- name: Upload e2e test videos to Artifacts
136-
uses: actions/upload-artifact@v3
138+
uses: actions/upload-artifact@v4
137139
if: always()
138140
with:
139-
name: e2e-test-videos
141+
name: e2e-test-videos-${{ matrix.node-version }}
140142
path: cypress/videos
141143

142144
# If e2e tests fail, Cypress creates a screenshot of what happened
143145
# Save those in an Artifact
144146
- name: Upload e2e test failure screenshots to Artifacts
145-
uses: actions/upload-artifact@v3
147+
uses: actions/upload-artifact@v4
146148
if: failure()
147149
with:
148-
name: e2e-test-screenshots
150+
name: e2e-test-screenshots-${{ matrix.node-version }}
149151
path: cypress/screenshots
150152

151153
- name: Stop app (in case it stays up after e2e tests)
@@ -180,7 +182,7 @@ jobs:
180182
run: kill -9 $(lsof -t -i:4000)
181183

182184
- name: Shutdown Docker containers
183-
run: docker-compose -f ./docker/docker-compose-ci.yml down
185+
run: docker compose -f ./docker/docker-compose-ci.yml down
184186

185187
# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
186188
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
@@ -191,22 +193,27 @@ jobs:
191193
runs-on: ubuntu-latest
192194
steps:
193195
- name: Checkout
194-
uses: actions/checkout@v3
196+
uses: actions/checkout@v4
195197

196198
# Download artifacts from previous 'tests' job
197199
- name: Download coverage artifacts
198-
uses: actions/download-artifact@v3
200+
uses: actions/download-artifact@v4
199201

200202
# Now attempt upload to Codecov using its action.
201203
# NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
202204
#
203205
# Retry action: https://github.com/marketplace/actions/retry-action
204206
# Codecov action: https://github.com/codecov/codecov-action
205207
- name: Upload coverage to Codecov.io
206-
uses: Wandalen/wretry.action@v1.0.36
208+
uses: Wandalen/wretry.action@v1.3.0
207209
with:
208-
action: codecov/codecov-action@v3
209-
# Try upload 5 times max
210+
action: codecov/codecov-action@v4
211+
# Ensure codecov-action throws an error when it fails to upload
212+
# This allows us to auto-restart the action if an error is thrown
213+
with: |
214+
fail_ci_if_error: true
215+
token: ${{ secrets.CODECOV_TOKEN }}
216+
# Try re-running action 5 times max
210217
attempt_limit: 5
211218
# Run again in 30 seconds
212219
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: 30 additions & 121 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:
@@ -15,136 +18,42 @@ on:
1518
permissions:
1619
contents: read # to fetch code (actions/checkout)
1720

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-
38-
3921
jobs:
40-
###############################################
22+
#############################################################
4123
# Build/Push the 'dspace/dspace-angular' image
42-
###############################################
24+
#############################################################
4325
dspace-angular:
4426
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
4527
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/login-action
62-
- name: Login to DockerHub
63-
# Only login if not a PR, as PRs only trigger a Docker build and not a push
64-
if: github.event_name != 'pull_request'
65-
uses: docker/login-action@v2
66-
with:
67-
username: ${{ secrets.DOCKER_USERNAME }}
68-
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
69-
70-
# https://github.com/docker/metadata-action
71-
# Get Metadata for docker_build step below
72-
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular' image
73-
id: meta_build
74-
uses: docker/metadata-action@v4
75-
with:
76-
images: dspace/dspace-angular
77-
tags: ${{ env.IMAGE_TAGS }}
78-
flavor: ${{ env.TAGS_FLAVOR }}
79-
80-
# https://github.com/docker/build-push-action
81-
- name: Build and push 'dspace-angular' image
82-
id: docker_build
83-
uses: docker/build-push-action@v4
84-
with:
85-
context: .
86-
file: ./Dockerfile
87-
platforms: ${{ env.PLATFORMS }}
88-
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
89-
# but we ONLY do an image push to DockerHub if it's NOT a PR
90-
push: ${{ github.event_name != 'pull_request' }}
91-
# Use tags / labels provided by 'docker/metadata-action' above
92-
tags: ${{ steps.meta_build.outputs.tags }}
93-
labels: ${{ steps.meta_build.outputs.labels }}
28+
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
29+
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@dspace-7_x
30+
with:
31+
build_id: dspace-angular-dev
32+
image_name: dspace/dspace-angular
33+
dockerfile_path: ./Dockerfile
34+
secrets:
35+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
36+
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
9437

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

0 commit comments

Comments
 (0)