Skip to content

Commit 52ef654

Browse files
committed
Fix CI: Node 18.x only, remove e2e/SSR/codecov, CodeQL v3
1 parent e6d4ca3 commit 52ef654

2 files changed

Lines changed: 6 additions & 224 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 221 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
strategy:
4545
# Create a matrix of Node versions to test against (in parallel)
4646
matrix:
47-
node-version: [18.x, 20.x]
47+
node-version: [18.x]
4848
# Do NOT exit immediately if one matrix job fails
4949
fail-fast: false
5050
# These are the actual CI steps to perform per job
@@ -120,223 +120,5 @@ jobs:
120120
path: 'coverage/dspace-angular/lcov.info'
121121
retention-days: 14
122122

123-
# Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
124-
- name: Login to ${{ env.DOCKER_REGISTRY }}
125-
uses: docker/login-action@v3
126-
with:
127-
registry: ${{ env.DOCKER_REGISTRY }}
128-
username: ${{ github.repository_owner }}
129-
password: ${{ secrets.GITHUB_TOKEN }}
130-
131-
# Using "docker compose" start backend using CI configuration
132-
# and load assetstore from a cached copy
133-
- name: Start DSpace REST Backend via Docker (for e2e tests)
134-
run: |
135-
docker compose -f ./docker/docker-compose-ci.yml up -d
136-
docker compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli
137-
docker container ls
138-
139-
# Run integration tests via Cypress.io
140-
# https://github.com/cypress-io/github-action
141-
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
142-
- name: Run e2e tests (integration tests)
143-
uses: cypress-io/github-action@v6
144-
with:
145-
# Run tests in Chrome, headless mode (default)
146-
browser: chrome
147-
# Start app before running tests (will be stopped automatically after tests finish)
148-
start: yarn run serve:ssr
149-
# Wait for backend & frontend to be available
150-
# NOTE: We use the 'sites' REST endpoint to also ensure the database is ready
151-
wait-on: http://127.0.0.1:8080/server/api/core/sites, http://127.0.0.1:4000
152-
# Wait for 2 mins max for everything to respond
153-
wait-on-timeout: 120
154-
155-
# Cypress always creates a video of all e2e tests (whether they succeeded or failed)
156-
# Save those in an Artifact
157-
- name: Upload e2e test videos to Artifacts
158-
uses: actions/upload-artifact@v4
159-
if: always()
160-
with:
161-
name: e2e-test-videos-${{ matrix.node-version }}
162-
path: cypress/videos
163-
164-
# If e2e tests fail, Cypress creates a screenshot of what happened
165-
# Save those in an Artifact
166-
- name: Upload e2e test failure screenshots to Artifacts
167-
uses: actions/upload-artifact@v4
168-
if: failure()
169-
with:
170-
name: e2e-test-screenshots-${{ matrix.node-version }}
171-
path: cypress/screenshots
172-
173-
- name: Stop app (in case it stays up after e2e tests)
174-
run: |
175-
app_pid=$(lsof -t -i:4000)
176-
if [[ ! -z $app_pid ]]; then
177-
echo "App was still up! (PID: $app_pid)"
178-
kill -9 $app_pid
179-
fi
180-
181-
# Start up the app with SSR enabled (run in background)
182-
- name: Start app in SSR (server-side rendering) mode
183-
run: |
184-
nohup yarn run serve:ssr &
185-
printf 'Waiting for app to start'
186-
until curl --output /dev/null --silent --head --fail http://127.0.0.1:4000/home; do
187-
printf '.'
188-
sleep 2
189-
done
190-
echo "App started successfully."
191-
192-
# Get homepage and verify that the <meta name="title"> tag includes "DSpace".
193-
# If it does, then SSR is working, as this tag is created by our MetadataService.
194-
# This step also prints entire HTML of homepage for easier debugging if grep fails.
195-
- name: Verify SSR (server-side rendering) on Homepage
196-
run: |
197-
result=$(wget -O- -q http://127.0.0.1:4000/home)
198-
echo "$result"
199-
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace
200-
201-
# Get a specific community in our test data and verify that the "<h1>" tag includes "Publications" (the community name).
202-
# If it does, then SSR is working.
203-
- name: Verify SSR on a Community page
204-
run: |
205-
result=$(wget -O- -q http://127.0.0.1:4000/communities/0958c910-2037-42a9-81c7-dca80e3892b4)
206-
echo "$result"
207-
echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Publications
208-
209-
# Get a specific collection in our test data and verify that the "<h1>" tag includes "Articles" (the collection name).
210-
# If it does, then SSR is working.
211-
- name: Verify SSR on a Collection page
212-
run: |
213-
result=$(wget -O- -q http://127.0.0.1:4000/collections/282164f5-d325-4740-8dd1-fa4d6d3e7200)
214-
echo "$result"
215-
echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Articles
216-
217-
# Get a specific publication in our test data and verify that the <meta name="title"> tag includes
218-
# the title of this publication. If it does, then SSR is working.
219-
- name: Verify SSR on a Publication page
220-
run: |
221-
result=$(wget -O- -q http://127.0.0.1:4000/entities/publication/6160810f-1e53-40db-81ef-f6621a727398)
222-
echo "$result"
223-
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "An Economic Model of Mortality Salience"
224-
225-
# Get a specific person in our test data and verify that the <meta name="title"> tag includes
226-
# the name of the person. If it does, then SSR is working.
227-
- name: Verify SSR on a Person page
228-
run: |
229-
result=$(wget -O- -q http://127.0.0.1:4000/entities/person/b1b2c768-bda1-448a-a073-fc541e8b24d9)
230-
echo "$result"
231-
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Simmons, Cameron"
232-
233-
# Get a specific project in our test data and verify that the <meta name="title"> tag includes
234-
# the name of the project. If it does, then SSR is working.
235-
- name: Verify SSR on a Project page
236-
run: |
237-
result=$(wget -O- -q http://127.0.0.1:4000/entities/project/46ccb608-a74c-4bf6-bc7a-e29cc7defea9)
238-
echo "$result"
239-
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "University Research Fellowship"
240-
241-
# Get a specific orgunit in our test data and verify that the <meta name="title"> tag includes
242-
# the name of the orgunit. If it does, then SSR is working.
243-
- name: Verify SSR on an OrgUnit page
244-
run: |
245-
result=$(wget -O- -q http://127.0.0.1:4000/entities/orgunit/9851674d-bd9a-467b-8d84-068deb568ccf)
246-
echo "$result"
247-
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Law and Development"
248-
249-
# Get a specific journal in our test data and verify that the <meta name="title"> tag includes
250-
# the name of the journal. If it does, then SSR is working.
251-
- name: Verify SSR on a Journal page
252-
run: |
253-
result=$(wget -O- -q http://127.0.0.1:4000/entities/journal/d4af6c3e-53d0-4757-81eb-566f3b45d63a)
254-
echo "$result"
255-
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology"
256-
257-
# Get a specific journal volume in our test data and verify that the <meta name="title"> tag includes
258-
# the name of the volume. If it does, then SSR is working.
259-
- name: Verify SSR on a Journal Volume page
260-
run: |
261-
result=$(wget -O- -q http://127.0.0.1:4000/entities/journalvolume/07c6249f-4bf7-494d-9ce3-6ffdb2aed538)
262-
echo "$result"
263-
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology Volume 28 (2017)"
264-
265-
# Get a specific journal issue in our test data and verify that the <meta name="title"> tag includes
266-
# the name of the issue. If it does, then SSR is working.
267-
- name: Verify SSR on a Journal Issue page
268-
run: |
269-
result=$(wget -O- -q http://127.0.0.1:4000/entities/journalissue/44c29473-5de2-48fa-b005-e5029aa1a50b)
270-
echo "$result"
271-
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology Vol. 28, No. 1"
272-
273-
# Verify 301 Handle redirect behavior
274-
# Note: /handle/123456789/260 is the same test Publication used by our e2e tests
275-
- name: Verify 301 redirect from '/handle' URLs
276-
run: |
277-
result=$(wget --server-response --quiet http://127.0.0.1:4000/handle/123456789/260 2>&1 | head -1 | awk '{print $2}')
278-
echo "$result"
279-
[[ "$result" -eq "301" ]]
280-
281-
# Verify 403 error code behavior
282-
- name: Verify 403 error code from '/403'
283-
run: |
284-
result=$(wget --server-response --quiet http://127.0.0.1:4000/403 2>&1 | head -1 | awk '{print $2}')
285-
echo "$result"
286-
[[ "$result" -eq "403" ]]
287-
288-
# Verify 404 error code behavior
289-
- name: Verify 404 error code from '/404' and on invalid pages
290-
run: |
291-
result=$(wget --server-response --quiet http://127.0.0.1:4000/404 2>&1 | head -1 | awk '{print $2}')
292-
echo "$result"
293-
result2=$(wget --server-response --quiet http://127.0.0.1:4000/invalidurl 2>&1 | head -1 | awk '{print $2}')
294-
echo "$result2"
295-
[[ "$result" -eq "404" && "$result2" -eq "404" ]]
296-
297-
# Verify 500 error code behavior
298-
- name: Verify 500 error code from '/500'
299-
run: |
300-
result=$(wget --server-response --quiet http://127.0.0.1:4000/500 2>&1 | head -1 | awk '{print $2}')
301-
echo "$result"
302-
[[ "$result" -eq "500" ]]
303-
304-
- name: Stop running app
305-
run: kill -9 $(lsof -t -i:4000)
306-
307-
- name: Shutdown Docker containers
308-
run: docker compose -f ./docker/docker-compose-ci.yml down
309-
310-
# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
311-
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
312-
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
313-
codecov:
314-
# Must run after 'tests' job above
315-
needs: tests
316-
runs-on: ubuntu-latest
317-
steps:
318-
- name: Checkout
319-
uses: actions/checkout@v4
320-
321-
# Download artifacts from previous 'tests' job
322-
- name: Download coverage artifacts
323-
uses: actions/download-artifact@v4
324-
325-
# Now attempt upload to Codecov using its action.
326-
# NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
327-
#
328-
# Retry action: https://github.com/marketplace/actions/retry-action
329-
# Codecov action: https://github.com/codecov/codecov-action
330-
- name: Upload coverage to Codecov.io
331-
uses: Wandalen/wretry.action@v1.3.0
332-
with:
333-
action: codecov/codecov-action@v4
334-
# Ensure codecov-action throws an error when it fails to upload
335-
# This allows us to auto-restart the action if an error is thrown
336-
with: |
337-
fail_ci_if_error: true
338-
token: ${{ secrets.CODECOV_TOKEN }}
339-
# Try re-running action 5 times max
340-
attempt_limit: 5
341-
# Run again in 30 seconds
342-
attempt_delay: 30000
123+
# NOTE: e2e tests, SSR verification and Docker backend steps have been removed.
124+
# This fork does not have a DSpace REST backend Docker image configured for CI.

.github/workflows/codescan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
# Initializes the CodeQL tools for scanning.
4141
# https://github.com/github/codeql-action
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v2
43+
uses: github/codeql-action/init@v3
4444
with:
4545
languages: javascript
4646

4747
# Autobuild attempts to build any compiled languages
4848
- name: Autobuild
49-
uses: github/codeql-action/autobuild@v2
49+
uses: github/codeql-action/autobuild@v3
5050

5151
# Perform GitHub Code Scanning.
5252
- name: Perform CodeQL Analysis
53-
uses: github/codeql-action/analyze@v2
53+
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)