Skip to content

Commit 8c8fad7

Browse files
authored
Merge pull request DSpace#2193 from tdonohue/update_actions
Split Codecov GitHub action to separate job & add retries. Update other actions.
2 parents 8ce1552 + 88ba37e commit 8c8fad7

3 files changed

Lines changed: 43 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
6969
- name: Get Yarn cache directory
7070
id: yarn-cache-dir-path
71-
run: echo "::set-output name=dir::$(yarn cache dir)"
71+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
7272
- name: Cache Yarn dependencies
7373
uses: actions/cache@v3
7474
with:
@@ -93,12 +93,16 @@ jobs:
9393
- name: Run specs (unit tests)
9494
run: yarn run test:headless
9595

96+
# Upload code coverage report to artifact (for one version of Node only),
97+
# so that it can be shared with the 'codecov' job (see below)
9698
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
97-
# Upload coverage reports to Codecov (for one version of Node only)
98-
# https://github.com/codecov/codecov-action
99-
- name: Upload coverage to Codecov.io
100-
uses: codecov/codecov-action@v3
101-
if: matrix.node-version == '16.x'
99+
- name: Upload code coverage report to Artifact
100+
uses: actions/upload-artifact@v3
101+
if: matrix.node-version == '18.x'
102+
with:
103+
name: dspace-angular coverage report
104+
path: 'coverage/dspace-angular/lcov.info'
105+
retention-days: 14
102106

103107
# Using docker-compose start backend using CI configuration
104108
# and load assetstore from a cached copy
@@ -112,11 +116,10 @@ jobs:
112116
# https://github.com/cypress-io/github-action
113117
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
114118
- name: Run e2e tests (integration tests)
115-
uses: cypress-io/github-action@v4
119+
uses: cypress-io/github-action@v5
116120
with:
117-
# Run tests in Chrome, headless mode
121+
# Run tests in Chrome, headless mode (default)
118122
browser: chrome
119-
headless: true
120123
# Start app before running tests (will be stopped automatically after tests finish)
121124
start: yarn run serve:ssr
122125
# Wait for backend & frontend to be available
@@ -176,3 +179,32 @@ jobs:
176179

177180
- name: Shutdown Docker containers
178181
run: docker-compose -f ./docker/docker-compose-ci.yml down
182+
183+
# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
184+
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
185+
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
186+
codecov:
187+
# Must run after 'tests' job above
188+
needs: tests
189+
runs-on: ubuntu-latest
190+
steps:
191+
- name: Checkout
192+
uses: actions/checkout@v3
193+
194+
# Download artifacts from previous 'tests' job
195+
- name: Download coverage artifacts
196+
uses: actions/download-artifact@v3
197+
198+
# Now attempt upload to Codecov using its action.
199+
# NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
200+
#
201+
# Retry action: https://github.com/marketplace/actions/retry-action
202+
# Codecov action: https://github.com/codecov/codecov-action
203+
- name: Upload coverage to Codecov.io
204+
uses: Wandalen/wretry.action@v1.0.36
205+
with:
206+
action: codecov/codecov-action@v3
207+
# Try upload 5 times max
208+
attempt_limit: 5
209+
# Run again in 30 seconds
210+
attempt_delay: 30000

.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.3.0
19+
uses: actions/add-to-project@v0.5.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/label_merge_conflicts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
steps:
2424
# See: https://github.com/prince-chrismc/label-merge-conflicts-action
2525
- name: Auto-label PRs with merge conflicts
26-
uses: prince-chrismc/label-merge-conflicts-action@v2
26+
uses: prince-chrismc/label-merge-conflicts-action@v3
2727
# Add "merge conflict" label if a merge conflict is detected. Remove it when resolved.
2828
# Note, the authentication token is created automatically
2929
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token

0 commit comments

Comments
 (0)