Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Create Release
on: push
name: Create Release Tag
on:
push:
branches:
- master

jobs:
create_release:
name: build
name: Create Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v5
Expand Down Expand Up @@ -40,4 +42,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.SPEC_VERSION }}
release_name: ${{ env.SPEC_VERSION }}
release_name: ${{ env.SPEC_VERSION }}
29 changes: 29 additions & 0 deletions .github/workflows/pr-jira-link.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Create PR JIRA Link
on:
pull_request:
types: [opened, synchronize]

jobs:
link-ticket:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
steps:
- name: Check ticket name conforms to requirements
run: echo $BRANCH_NAME | grep -i -E -q "(ved-[0-9]+)|(dependabot\/)"
continue-on-error: true

- name: Grab ticket name
run: echo "TICKET_NAME=$(echo $BRANCH_NAME | grep -i -o '\(ved-[0-9]\+\)' | tr '[:lower:]' '[:upper:]')" >> $GITHUB_ENV
continue-on-error: true

- name: Comment on PR with link to JIRA ticket
if: contains(env.TICKET_NAME, 'VED-')
continue-on-error: true
uses: unsplash/comment-on-pr@a9bf050e744c8282dee4bb0dbcf063186d8316c4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: |
This branch is working on a ticket in the NHS England VED JIRA Project. Here's a handy link to the ticket:
# [${{ env.TICKET_NAME }}](https://nhsd-jira.digital.nhs.uk/browse/${{ env.TICKET_NAME}})
30 changes: 0 additions & 30 deletions .github/workflows/pr-lint.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: SonarCloud
name: Quality Checks

on:
push:
Expand All @@ -12,14 +12,40 @@ env:
LAMBDA_PATH: ${{ github.workspace }}/lambdas

jobs:
sonarcloud:
name: SonarCloud
lint:
name: Lint specification and Python projects
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Install poetry
run: pip install poetry==2.1.4

# Base linting requires 3.8 due to APIM package dependencies. See root README for details under linting.
# Consider upgrading this and poetry deps if we move away from Azure DevOps to using the Proxygen tool.
- uses: actions/setup-python@v5
with:
python-version: 3.8
cache: 'poetry'

- uses: actions/setup-node@v5
with:
fetch-depth: 0
node-version: '23.11.0'
cache: 'npm'

- name: Install linting dependencies
run: make install-node && poetry install --no-root

- name: Lint
run: make lint

testcoverage_and_sonarcloud:
name: Test Coverage and SonarCloud
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Install poetry
run: pip install poetry==2.1.4
Expand Down Expand Up @@ -184,7 +210,7 @@ jobs:
fi

- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@master
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ It is not necessary to activate the virtual environment (using `source .venv/bin
The root-level virtual environment is primarily used for linting, as we create separate virtual environments for each folder that contains Lambda functions.
Steps:
1. Follow instructions above to [install dependencies](#install-dependencies) & [set up a virtual environment](#setting-up-a-virtual-environment-with-poetry).
**Note: While this project uses Python 3.10 (e.g. for Lambdas), the NHSDigital/api-management-utils repository — which orchestrates setup and linting — defaults to Python 3.8.
**Note: While this project uses Python 3.11 (e.g. for Lambdas), the NHSDigital/api-management-utils repository — which orchestrates setup and linting — defaults to Python 3.8.
The linting command is executed from within that repo but calls the Makefile in this project, so be aware of potential Python version mismatches when running or debugging locally or in the pipeline.**
2. Run `make lint`. This will:
- Check the linting of the API specification yaml.
Expand Down
4 changes: 2 additions & 2 deletions README.specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ To get started developing your API use this template repo alongside guidance pro
This folder contains templates that can be customised for items such as opening pull requests or issues within the repo

`/.github/workflows`: This folder contains templates for github action workflows such as:
- `pr-lint.yaml`: This workflow template shows how to link Pull Request's to Jira tickets and runs when a pull request is opened.
- `continuous-integration.yml`: This workflow template shows how to publish a Github release when pushing to master.
- `pr-jira-link.yaml`: This workflow template links Pull Requests to Jira tickets and runs when a pull request is opened.
- `create-release-tag.yml`: This workflow template shows how to publish a Github release when pushing to master.

#### `/azure`:

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[project]
name = "immunisation-fhir-api"
python = "^3.8"

[tool.poetry]
Expand Down
Loading