Skip to content

Commit

Permalink
Build: [AEA-4506] - Migrate to communal qc (#947)
Browse files Browse the repository at this point in the history
## Summary

- 🤖 Operational or Infrastructure Change

### Details

Replace the `quality-checks.yml` file in the repo with the communal one
shared across all EPS projects

---------

Co-authored-by: anthony-nhs <[email protected]>
  • Loading branch information
wildjames and anthony-nhs authored Oct 23, 2024
1 parent 9e7ffd0 commit 869a88f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 579 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:

jobs:
quality_checks:
uses: ./.github/workflows/quality_checks.yml
uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/quality-checks.yml@v3.0.0
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/pr-link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,25 @@ jobs:

- name: Grab ticket name
if: contains(github.event.pull_request.head.ref, 'aea-') || contains(github.event.pull_request.head.ref, 'AEA-') || contains(github.event.pull_request.head.ref, 'apm-') || contains(github.event.pull_request.head.ref, 'APM-') || contains(github.event.pull_request.head.ref, 'apmspii-') || contains(github.event.pull_request.head.ref, 'APMSPII-') || contains(github.event.pull_request.head.ref, 'adz-') || contains(github.event.pull_request.head.ref, 'ADZ-') || contains(github.event.pull_request.head.ref, 'amb-') || contains(github.event.pull_request.head.ref, 'AMB-')
run: echo name=TICKET_NAME::"$(echo "$REF" | grep -i -o '\(aea-[0-9]\+\)\|\(apm-[0-9]\+\)\|\(apmspii-[0-9]\+\)\|\(adz-[0-9]\+\)|\(amb-[0-9]\+\)' | tr '[:lower:]' '[:upper:]')" >> "$GITHUB_ENV"
continue-on-error: true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
# Match ticket name patterns
REGEX='
(aea-[0-9]+)|
(apm-[0-9]+)|
(apmspii-[0-9]+)|
(adz-[0-9]+)|
(amb-[0-9]+)
'
# Remove whitespace and newlines from the regex
REGEX=$(echo "$REGEX" | tr -d '[:space:]')
# Extract the ticket name and convert to uppercase
TICKET_NAME=$(echo "$REF" | grep -i -E -o "$REGEX" | tr '[:lower:]' '[:upper:]')
# Set the environment variable
echo "TICKET_NAME=$TICKET_NAME" >> "$GITHUB_ENV"
- name: Comment on PR with link to JIRA ticket
if: contains(github.event.pull_request.head.ref, 'aea-') || contains(github.event.pull_request.head.ref, 'AEA-') || contains(github.event.pull_request.head.ref, 'apm-') || contains(github.event.pull_request.head.ref, 'APM-') || contains(github.event.pull_request.head.ref, 'apmspii-') || contains(github.event.pull_request.head.ref, 'APMSPII-') || contains(github.event.pull_request.head.ref, 'adz-') || contains(github.event.pull_request.head.ref, 'ADZ-') || contains(github.event.pull_request.head.ref, 'amb-') || contains(github.event.pull_request.head.ref, 'AMB-')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:

jobs:
quality_checks:
uses: ./.github/workflows/quality_checks.yml
uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/quality-checks.yml@v3.0.0
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Expand Down
79 changes: 0 additions & 79 deletions .github/workflows/quality_checks.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

jobs:
quality_checks:
uses: ./.github/workflows/quality_checks.yml
uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/quality-checks.yml@v3.0.0
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ Workflows are in the `.github/workflows` folder:
- `pr_title_check.yaml` Checks title of pull request is valid.
- `pr-link.yaml` This workflow template links Pull Requests to Jira tickets and runs when a pull request is opened.
- `pull_request.yml` Called when pull request is opened or updated. Calls run_package_code_and_api and run_release_code_and_api to build and deploy the code. Deploys to dev AWS account and internal-dev and internal-dev sandbox apigee environments. The main stack deployed adopts the naming convention psu-pr-<PULL_REQUEST_ID>, while the sandbox stack follows the pattern psu-sandbox-pr-<PULL_REQUEST_ID>
- `quality_checks.yml` Runs check-licenses, lint, test and SonarCloud scan against the repo. Called from ci.yml, pull_request.yml and release.yml
- `release.yml` Runs on demand to create a release and deploy to all environments.
- `run_package_code_and_api.yml` Packages code and api and uploads to a github artifact for later deployment.
- `run_release_code_and_api.yml` Release code and api built by run_package_code_and_api.yml to an environment.
Expand Down
Loading

0 comments on commit 869a88f

Please sign in to comment.