From e7e13179879d92c43a5f6f2e6a25f2e9a34f6ac7 Mon Sep 17 00:00:00 2001 From: milanmajchrak <90026355+milanmajchrak@users.noreply.github.com> Date: Wed, 30 Mar 2022 15:43:32 +0200 Subject: [PATCH 01/17] Update pull_request_template.md --- .github/pull_request_template.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b11e3cd531cf..651f9e167544 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,19 +1,18 @@ -## References -_Add references/links to any related issues or PRs. These may include:_ -* Fixes #[issue-number] -* Related to [REST Contract](https://github.com/DSpace/Rest7Contract) - -## Description -Short summary of changes (1-2 sentences). - -## Instructions for Reviewers -Please add a more detailed description of the changes made by your PR. At a minimum, providing a bulleted list of changes in your PR is helpful to reviewers. - -List of changes in this PR: -* First, ... -* Second, ... - -**Include guidance for how to test or review your PR.** This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes. +| Phases | MM | MB | Total | +|-----------------|----:|----:|-------:| +| ETA | 0 | 0 | 0 | +| Developing | 0 | 0 | 0 | +| Review | 0 | 0 | 0 | +| Total | - | - | 0 | +| ETA est. | | | 0 | +| ETA cust. | - | - | 0 | +## Problem description +### Reported issues +### Not-reported issues +## Analysis +(Write here, if there is needed describe some specific problem. Erase it, when it is not needed.) +## Problems +(Write here, if some unexpected problems occur during solving issues. Erase it, when it is not needed.) ## Checklist _This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!_ From 56d5ab1a4ffe087f3683cfdd758e7cb19494fe4a Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 31 Mar 2022 15:34:50 +0200 Subject: [PATCH 02/17] first test --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 864a099c1de5..7b54ba9c73dc 100644 --- a/README.md +++ b/README.md @@ -139,3 +139,6 @@ The full license is available in the [LICENSE](LICENSE) file or online at http:/ DSpace uses third-party libraries which may be distributed under different licenses. Those licenses are listed in the [LICENSES_THIRD_PARTY](LICENSES_THIRD_PARTY) file. + + + \ No newline at end of file From 8bff635e7fbbb5f26dc7e88d32915f81deef2ae8 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 31 Mar 2022 15:43:06 +0200 Subject: [PATCH 03/17] also run docker here --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 34539abc16bd..01803e294cea 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -14,8 +14,8 @@ on: jobs: docker: - # Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace' - if: github.repository == 'dspace/dspace' + # Ensure this job never runs on forked repos. It's only executed for our repo + if: github.repository == 'dataquest-dev/dspace' runs-on: ubuntu-latest env: # Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action) From a7b603e90e1b0b0ca3902031586e9d0fc3fddf22 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 31 Mar 2022 15:51:24 +0200 Subject: [PATCH 04/17] run docker now pls --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 01803e294cea..ba5cf3f4a39c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,8 +6,8 @@ name: Docker images on: push: branches: - - main - - 'dspace-**' + - testtest + - dtq-dev tags: - 'dspace-**' pull_request: From c8ed470db2079b40dfeeceffa5a5cb748e133329 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 31 Mar 2022 15:52:42 +0200 Subject: [PATCH 05/17] run docker now pls --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ba5cf3f4a39c..ffe336dc85fd 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,7 +6,7 @@ name: Docker images on: push: branches: - - testtest + - testtests - dtq-dev tags: - 'dspace-**' From 5adcfeb517ffd24dee3a53d0286574a1cbfb70f5 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 31 Mar 2022 16:02:16 +0200 Subject: [PATCH 06/17] moved unused actions away --- .github/workflows/issue_opened.yml | 29 --------------------- .github/workflows/label_merge_conflicts.yml | 25 ------------------ 2 files changed, 54 deletions(-) delete mode 100644 .github/workflows/issue_opened.yml delete mode 100644 .github/workflows/label_merge_conflicts.yml diff --git a/.github/workflows/issue_opened.yml b/.github/workflows/issue_opened.yml deleted file mode 100644 index 3ccdd22a0ddd..000000000000 --- a/.github/workflows/issue_opened.yml +++ /dev/null @@ -1,29 +0,0 @@ -# This workflow runs whenever a new issue is created -name: Issue opened - -on: - issues: - types: [opened] - -jobs: - automation: - runs-on: ubuntu-latest - steps: - # Add the new issue to a project board, if it needs triage - # See https://github.com/marketplace/actions/create-project-card-action - - name: Add issue to project board - # Only add to project board if issue is flagged as "needs triage" or has no labels - # NOTE: By default we flag new issues as "needs triage" in our issue template - if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '') - uses: technote-space/create-project-card-action@v1 - # Note, the authentication token below is an ORG level Secret. - # It must be created/recreated manually via a personal access token with "public_repo" and "admin:org" permissions - # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token - # This is necessary because the "DSpace Backlog" project is an org level project (i.e. not repo specific) - with: - GITHUB_TOKEN: ${{ secrets.ORG_PROJECT_TOKEN }} - PROJECT: DSpace Backlog - COLUMN: Triage - CHECK_ORG_PROJECT: true - # Ignore errors. - continue-on-error: true diff --git a/.github/workflows/label_merge_conflicts.yml b/.github/workflows/label_merge_conflicts.yml deleted file mode 100644 index dcbab18f1b57..000000000000 --- a/.github/workflows/label_merge_conflicts.yml +++ /dev/null @@ -1,25 +0,0 @@ -# This workflow checks open PRs for merge conflicts and labels them when conflicts are found -name: Check for merge conflicts - -# Run whenever the "main" branch is updated -# NOTE: This means merge conflicts are only checked for when a PR is merged to main. -on: - push: - branches: - - main - -jobs: - triage: - runs-on: ubuntu-latest - steps: - # See: https://github.com/mschilde/auto-label-merge-conflicts/ - - name: Auto-label PRs with merge conflicts - uses: mschilde/auto-label-merge-conflicts@v2.0 - # Add "merge conflict" label if a merge conflict is detected. Remove it when resolved. - # Note, the authentication token is created automatically - # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token - with: - CONFLICT_LABEL_NAME: 'merge conflict' - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Ignore errors - continue-on-error: true From 6ed4d48fd91a7f4aa62ca95ed3e2fe00d0d598ac Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 31 Mar 2022 16:19:25 +0200 Subject: [PATCH 07/17] corrected dspace destination --- .github/disabled-workflows/issue_opened.yml | 29 +++++++++++++++++++ .../label_merge_conflicts.yml | 25 ++++++++++++++++ README.md | 3 +- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .github/disabled-workflows/issue_opened.yml create mode 100644 .github/disabled-workflows/label_merge_conflicts.yml diff --git a/.github/disabled-workflows/issue_opened.yml b/.github/disabled-workflows/issue_opened.yml new file mode 100644 index 000000000000..3ccdd22a0ddd --- /dev/null +++ b/.github/disabled-workflows/issue_opened.yml @@ -0,0 +1,29 @@ +# This workflow runs whenever a new issue is created +name: Issue opened + +on: + issues: + types: [opened] + +jobs: + automation: + runs-on: ubuntu-latest + steps: + # Add the new issue to a project board, if it needs triage + # See https://github.com/marketplace/actions/create-project-card-action + - name: Add issue to project board + # Only add to project board if issue is flagged as "needs triage" or has no labels + # NOTE: By default we flag new issues as "needs triage" in our issue template + if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '') + uses: technote-space/create-project-card-action@v1 + # Note, the authentication token below is an ORG level Secret. + # It must be created/recreated manually via a personal access token with "public_repo" and "admin:org" permissions + # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token + # This is necessary because the "DSpace Backlog" project is an org level project (i.e. not repo specific) + with: + GITHUB_TOKEN: ${{ secrets.ORG_PROJECT_TOKEN }} + PROJECT: DSpace Backlog + COLUMN: Triage + CHECK_ORG_PROJECT: true + # Ignore errors. + continue-on-error: true diff --git a/.github/disabled-workflows/label_merge_conflicts.yml b/.github/disabled-workflows/label_merge_conflicts.yml new file mode 100644 index 000000000000..dcbab18f1b57 --- /dev/null +++ b/.github/disabled-workflows/label_merge_conflicts.yml @@ -0,0 +1,25 @@ +# This workflow checks open PRs for merge conflicts and labels them when conflicts are found +name: Check for merge conflicts + +# Run whenever the "main" branch is updated +# NOTE: This means merge conflicts are only checked for when a PR is merged to main. +on: + push: + branches: + - main + +jobs: + triage: + runs-on: ubuntu-latest + steps: + # See: https://github.com/mschilde/auto-label-merge-conflicts/ + - name: Auto-label PRs with merge conflicts + uses: mschilde/auto-label-merge-conflicts@v2.0 + # Add "merge conflict" label if a merge conflict is detected. Remove it when resolved. + # Note, the authentication token is created automatically + # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token + with: + CONFLICT_LABEL_NAME: 'merge conflict' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Ignore errors + continue-on-error: true diff --git a/README.md b/README.md index 7b54ba9c73dc..9aac71d6c4c6 100644 --- a/README.md +++ b/README.md @@ -141,4 +141,5 @@ DSpace uses third-party libraries which may be distributed under different licen in the [LICENSES_THIRD_PARTY](LICENSES_THIRD_PARTY) file. - \ No newline at end of file + + \ No newline at end of file From e9ac784be00191ae9914b0a363d26bd4b63f4cd6 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 31 Mar 2022 16:30:20 +0200 Subject: [PATCH 08/17] correct now? --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ffe336dc85fd..7ca29929f4a5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -59,7 +59,7 @@ jobs: id: meta_build_deps uses: docker/metadata-action@v3 with: - images: dspace/dspace-dependencies + images: regreb01/dspace-dependencies tags: ${{ env.IMAGE_TAGS }} flavor: ${{ env.TAGS_FLAVOR }} @@ -85,7 +85,7 @@ jobs: id: meta_build uses: docker/metadata-action@v3 with: - images: dspace/dspace + images: regreb01/dspace tags: ${{ env.IMAGE_TAGS }} flavor: ${{ env.TAGS_FLAVOR }} @@ -110,7 +110,7 @@ jobs: id: meta_build_test uses: docker/metadata-action@v3 with: - images: dspace/dspace + images: regreb01/dspace tags: ${{ env.IMAGE_TAGS }} # As this is a test/development image, its tags are all suffixed with "-test". Otherwise, it uses the same # tagging logic as the primary 'dspace/dspace' image above. @@ -138,7 +138,7 @@ jobs: id: meta_build_cli uses: docker/metadata-action@v3 with: - images: dspace/dspace-cli + images: regreb01/dspace-cli tags: ${{ env.IMAGE_TAGS }} flavor: ${{ env.TAGS_FLAVOR }} From e91ac6872f0ef3bcbcaa1c57a7547805c0b0ae15 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 31 Mar 2022 17:19:41 +0200 Subject: [PATCH 09/17] Testing LGTM --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 9aac71d6c4c6..864a099c1de5 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,3 @@ The full license is available in the [LICENSE](LICENSE) file or online at http:/ DSpace uses third-party libraries which may be distributed under different licenses. Those licenses are listed in the [LICENSES_THIRD_PARTY](LICENSES_THIRD_PARTY) file. - - - - \ No newline at end of file From a8c3568c259b02ba38fe2f8bcf25811f4f5a0655 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 31 Mar 2022 17:39:05 +0200 Subject: [PATCH 10/17] none --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 864a099c1de5..2c58deacff3b 100644 --- a/README.md +++ b/README.md @@ -139,3 +139,4 @@ The full license is available in the [LICENSE](LICENSE) file or online at http:/ DSpace uses third-party libraries which may be distributed under different licenses. Those licenses are listed in the [LICENSES_THIRD_PARTY](LICENSES_THIRD_PARTY) file. + \ No newline at end of file From 7464b30bed95d4db192242c7ff119069b3736786 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 31 Mar 2022 17:55:05 +0200 Subject: [PATCH 11/17] updated docker destination --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7ca29929f4a5..4fdfb5064f57 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -59,7 +59,7 @@ jobs: id: meta_build_deps uses: docker/metadata-action@v3 with: - images: regreb01/dspace-dependencies + images: dataquest/dspace-dependencies tags: ${{ env.IMAGE_TAGS }} flavor: ${{ env.TAGS_FLAVOR }} @@ -85,7 +85,7 @@ jobs: id: meta_build uses: docker/metadata-action@v3 with: - images: regreb01/dspace + images: dataquest/dspace tags: ${{ env.IMAGE_TAGS }} flavor: ${{ env.TAGS_FLAVOR }} @@ -110,7 +110,7 @@ jobs: id: meta_build_test uses: docker/metadata-action@v3 with: - images: regreb01/dspace + images: dataquest/dspace tags: ${{ env.IMAGE_TAGS }} # As this is a test/development image, its tags are all suffixed with "-test". Otherwise, it uses the same # tagging logic as the primary 'dspace/dspace' image above. @@ -138,7 +138,7 @@ jobs: id: meta_build_cli uses: docker/metadata-action@v3 with: - images: regreb01/dspace-cli + images: dataquest/dspace-cli tags: ${{ env.IMAGE_TAGS }} flavor: ${{ env.TAGS_FLAVOR }} From 66451134f4dd104d19872db3232ebe75d6d68174 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Mon, 4 Apr 2022 07:59:17 +0200 Subject: [PATCH 12/17] Ready for PR --- .github/workflows/docker.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4fdfb5064f57..19c89c507e64 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,15 +1,12 @@ # DSpace Docker image build for hub.docker.com name: Docker images -# Run this Build for all pushes to 'main' or maintenance branches, or tagged releases. +# Run this Build for all pushes to dtq-dev branch # Also run for PRs to ensure PR doesn't break Docker build process on: push: branches: - - testtests - dtq-dev - tags: - - 'dspace-**' pull_request: jobs: @@ -51,7 +48,7 @@ jobs: password: ${{ secrets.DOCKER_ACCESS_TOKEN }} #################################################### - # Build/Push the 'dspace/dspace-dependencies' image + # Build/Push the 'dataquest/dspace-dependencies' image #################################################### # https://github.com/docker/metadata-action # Get Metadata for docker_build_deps step below @@ -78,7 +75,7 @@ jobs: labels: ${{ steps.meta_build_deps.outputs.labels }} ####################################### - # Build/Push the 'dspace/dspace' image + # Build/Push the 'dataquest/dspace' image ####################################### # Get Metadata for docker_build step below - name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace' image @@ -103,7 +100,7 @@ jobs: labels: ${{ steps.meta_build.outputs.labels }} ##################################################### - # Build/Push the 'dspace/dspace' image ('-test' tag) + # Build/Push the 'dataquest/dspace' image ('-test' tag) ##################################################### # Get Metadata for docker_build_test step below - name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-test' image @@ -113,7 +110,7 @@ jobs: images: dataquest/dspace tags: ${{ env.IMAGE_TAGS }} # As this is a test/development image, its tags are all suffixed with "-test". Otherwise, it uses the same - # tagging logic as the primary 'dspace/dspace' image above. + # tagging logic as the primary 'dataquest/dspace' image above. flavor: ${{ env.TAGS_FLAVOR }} suffix=-test @@ -131,7 +128,7 @@ jobs: labels: ${{ steps.meta_build_test.outputs.labels }} ########################################### - # Build/Push the 'dspace/dspace-cli' image + # Build/Push the 'dataquest/dspace-cli' image ########################################### # Get Metadata for docker_build_test step below - name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-cli' image From 8aa563fd02db426ceee124e11b9ed6f29f257a42 Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Mon, 4 Apr 2022 08:45:02 +0200 Subject: [PATCH 13/17] Removed build badge which belonged to dspace/dspace not us --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 864a099c1de5..e932f2109090 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # DSpace -[![Build Status](https://github.com/DSpace/DSpace/workflows/Build/badge.svg)](https://github.com/DSpace/DSpace/actions?query=workflow%3ABuild) - [DSpace Documentation](https://wiki.lyrasis.org/display/DSDOC/) | [DSpace Releases](https://github.com/DSpace/DSpace/releases) | [DSpace Wiki](https://wiki.lyrasis.org/display/DSPACE/Home) | From 9e5428c02b06a0a593191da5f0780d5d75f0358c Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Mon, 4 Apr 2022 12:28:57 +0200 Subject: [PATCH 14/17] another codecov attempt --- .github/workflows/build.yml | 2 ++ .github/workflows/docker.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4060dbd672a1..045944804520 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,3 +81,5 @@ jobs: # https://github.com/codecov/codecov-action - name: Upload coverage to Codecov.io uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 19c89c507e64..84acd883f6ce 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,6 +7,7 @@ on: push: branches: - dtq-dev + - fix/6-cicd-pipeline pull_request: jobs: From 98b15e3ae5abb639af23cfb55a3ebfa795075a1e Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Mon, 4 Apr 2022 13:29:53 +0200 Subject: [PATCH 15/17] added badge, removed branch to build in docker CICD --- .github/workflows/docker.yml | 1 - README.md | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 84acd883f6ce..19c89c507e64 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,7 +7,6 @@ on: push: branches: - dtq-dev - - fix/6-cicd-pipeline pull_request: jobs: diff --git a/README.md b/README.md index eabee95881c5..5f0246152f37 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ +[![codecov](https://codecov.io/gh/dataquest-dev/DSpace/branch/dtq-dev/graph/badge.svg?token=YI6CJNFI2H)](https://codecov.io/gh/dataquest-dev/DSpace) + # DSpace [DSpace Documentation](https://wiki.lyrasis.org/display/DSDOC/) | From 51e4554eefae3e479cac97c3006d5ed8952373a0 Mon Sep 17 00:00:00 2001 From: MajoBerger <88670521+MajoBerger@users.noreply.github.com> Date: Thu, 7 Apr 2022 15:57:15 +0200 Subject: [PATCH 16/17] added badge --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5f0246152f37..8c1a98a53eb0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - +[![Build](https://github.com/dataquest-dev/DSpace/actions/workflows/build.yml/badge.svg)](https://github.com/dataquest-dev/DSpace/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/dataquest-dev/DSpace/branch/dtq-dev/graph/badge.svg?token=YI6CJNFI2H)](https://codecov.io/gh/dataquest-dev/DSpace) # DSpace @@ -139,4 +139,4 @@ The full license is available in the [LICENSE](LICENSE) file or online at http:/ DSpace uses third-party libraries which may be distributed under different licenses. Those licenses are listed in the [LICENSES_THIRD_PARTY](LICENSES_THIRD_PARTY) file. - \ No newline at end of file + From da71bdb035e81a5d29454355d90fb1823bbc20ea Mon Sep 17 00:00:00 2001 From: MajoBerger Date: Thu, 7 Apr 2022 16:08:59 +0200 Subject: [PATCH 17/17] Separated push and pull_request actions --- .github/workflows/build.yml | 6 ++- .github/workflows/push.yml | 85 +++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 045944804520..4936720e0f5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,12 @@ # DSpace Continuous Integration/Build via GitHub Actions # Concepts borrowed from # https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-java-with-maven -name: Build +name: Build on pull_request # Run this Build for all pushes / PRs to current branch -on: [push, pull_request] +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] jobs: tests: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 000000000000..ea09844dbed5 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,85 @@ +# DSpace Continuous Integration/Build via GitHub Actions +# Concepts borrowed from +# https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-java-with-maven +name: Build on push + +# Run this Build for all pushes / PRs to current branch +on: [push] + +jobs: + tests: + runs-on: ubuntu-latest + env: + # Give Maven 1GB of memory to work with + # Suppress all Maven "downloading" messages in logs (see https://stackoverflow.com/a/35653426) + # This also slightly speeds builds, as there is less logging + MAVEN_OPTS: "-Xmx1024M -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" + strategy: + # Create a matrix of two separate configurations for Unit vs Integration Tests + # This will ensure those tasks are run in parallel + # Also specify version of Java to use (this can allow us to optionally run tests on multiple JDKs in future) + matrix: + include: + # NOTE: Unit Tests include deprecated REST API v6 (as it has unit tests) + # - surefire.rerunFailingTestsCount => try again for flakey tests, and keep track of/report on number of retries + - type: "Unit Tests" + java: 11 + mvnflags: "-DskipUnitTests=false -Pdspace-rest -Dsurefire.rerunFailingTestsCount=2" + resultsdir: "**/target/surefire-reports/**" + # NOTE: ITs skip all code validation checks, as they are already done by Unit Test job. + # - enforcer.skip => Skip maven-enforcer-plugin rules + # - checkstyle.skip => Skip all checkstyle checks by maven-checkstyle-plugin + # - license.skip => Skip all license header checks by license-maven-plugin + # - xml.skip => Skip all XML/XSLT validation by xml-maven-plugin + # - failsafe.rerunFailingTestsCount => try again for flakey tests, and keep track of/report on number of retries + - type: "Integration Tests" + java: 11 + mvnflags: "-DskipIntegrationTests=false -Denforcer.skip=true -Dcheckstyle.skip=true -Dlicense.skip=true -Dxml.skip=true -Dfailsafe.rerunFailingTestsCount=2" + resultsdir: "**/target/failsafe-reports/**" + # Do NOT exit immediately if one matrix job fails + # This ensures ITs continue running even if Unit Tests fail, or visa versa + fail-fast: false + name: Run ${{ matrix.type }} + # These are the actual CI steps to perform per job + steps: + # https://github.com/actions/checkout + - name: Checkout codebase + uses: actions/checkout@v2 + + # https://github.com/actions/setup-java + - name: Install JDK ${{ matrix.java }} + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + + # https://github.com/actions/cache + - name: Cache Maven dependencies + uses: actions/cache@v2 + with: + # Cache entire ~/.m2/repository + path: ~/.m2/repository + # Cache key is hash of all pom.xml files. Therefore any changes to POMs will invalidate cache + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-maven- + + # Run parallel Maven builds based on the above 'strategy.matrix' + - name: Run Maven ${{ matrix.type }} + env: + TEST_FLAGS: ${{ matrix.mvnflags }} + run: mvn install -B -V -P-assembly -Pcoverage-report $TEST_FLAGS + + # If previous step failed, save results of tests to downloadable artifact for this job + # (This artifact is downloadable at the bottom of any job's summary page) + - name: Upload Results of ${{ matrix.type }} to Artifact + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.type }} results + path: ${{ matrix.resultsdir }} + + # https://github.com/codecov/codecov-action + - name: Upload coverage to Codecov.io + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos