Skip to content

Commit 16c3438

Browse files
BCSS-20316: Amend Workflows (#28)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description <!-- Describe your changes in detail. --> This pulls in the changes from the playwright-python-blueprint around reworked workflows, and adds some amended logic we previously applied to the bcss-playwright repository to only run the util tests as part of our workflow and avoid trying to run any example tests. ## Context <!-- Why is this change required? What problem does it solve? --> This stops the release workflow that would fail due to populating the version information with 'unknown' for every release, removing the need to manually remove it to allow the workflow to pass. ## Type of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. --> - [x] Refactoring (non-breaking change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would change existing functionality) - [x] Bug fix (non-breaking change which fixes an issue) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I am familiar with the [contributing guidelines](https://github.com/nhs-england-tools/playwright-python-blueprint/blob/main/CONTRIBUTING.md) - [x] I have followed the code style of the project - [ ] I have added tests to cover my changes (where appropriate) - [ ] I have updated the documentation accordingly - [ ] This PR is a result of pair or mob programming --- ## Sensitive Information Declaration To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter. - [x] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.
1 parent fb8264a commit 16c3438

File tree

9 files changed

+67
-470
lines changed

9 files changed

+67
-470
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Run Util & Example Tests"
2+
runs-on: ubuntu-latest
3+
timeout-minutes: 3
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Set up Python
8+
uses: actions/setup-python@v5
9+
with:
10+
python-version: '3.13'
11+
- name: Install dependencies
12+
shell: bash
13+
run: |
14+
python -m pip install --upgrade pip
15+
pip install -r requirements.txt
16+
- name: Ensure browsers are installed
17+
shell: bash
18+
run: python -m playwright install --with-deps
19+
- name: Run util tests
20+
shell: bash
21+
run: pytest -m "utils" --ignore=tests/
22+
- uses: actions/upload-artifact@v4
23+
if: ${{ !cancelled() }}
24+
with:
25+
name: result-output-utils
26+
path: test-results/
27+
retention-days: 3
28+
- name: Run example tests
29+
shell: bash
30+
run: pytest --ignore=tests_utils/
31+
- uses: actions/upload-artifact@v4
32+
if: ${{ !cancelled() }}
33+
with:
34+
name: result-output-example
35+
path: test-results/
36+
retention-days: 3
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Run Util Tests"
2+
runs-on: ubuntu-latest
3+
timeout-minutes: 3
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Set up Python
8+
uses: actions/setup-python@v5
9+
with:
10+
python-version: '3.13'
11+
- name: Install dependencies
12+
shell: bash
13+
run: |
14+
python -m pip install --upgrade pip
15+
pip install -r requirements.txt
16+
- name: Run util tests
17+
shell: bash
18+
run: pytest -m "utils" --ignore=tests/
19+
- uses: actions/upload-artifact@v4
20+
if: ${{ !cancelled() }}
21+
with:
22+
name: result-output-utils
23+
path: test-results/
24+
retention-days: 3
25+

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -87,29 +87,3 @@ jobs:
8787
python_version: "${{ needs.metadata.outputs.python_version }}"
8888
version: "${{ needs.metadata.outputs.version }}"
8989
secrets: inherit
90-
build-stage: # Recommended maximum execution time is 3 minutes
91-
name: "Build & Assurance stage"
92-
needs: [metadata, test-stage]
93-
uses: ./.github/workflows/stage-3-build.yaml
94-
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened'))
95-
with:
96-
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
97-
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
98-
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
99-
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
100-
python_version: "${{ needs.metadata.outputs.python_version }}"
101-
version: "${{ needs.metadata.outputs.version }}"
102-
secrets: inherit
103-
# acceptance-stage: # Recommended maximum execution time is 10 minutes
104-
# name: "Acceptance stage"
105-
# needs: [metadata, build-stage]
106-
# uses: ./.github/workflows/stage-4-acceptance.yaml
107-
# if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened'))
108-
# with:
109-
# build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
110-
# build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
111-
# build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
112-
# nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
113-
# python_version: "${{ needs.metadata.outputs.python_version }}"
114-
# version: "${{ needs.metadata.outputs.version }}"
115-
# secrets: inherit

.github/workflows/cicd-2-publish.yaml

Lines changed: 0 additions & 95 deletions
This file was deleted.

.github/workflows/cicd-3-deploy.yaml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/stage-2-test.yaml

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -29,62 +29,12 @@ on:
2929
type: string
3030

3131
jobs:
32-
test-unit:
33-
name: "Unit tests"
32+
run-tests:
33+
name: "Run Util Tests"
3434
runs-on: ubuntu-latest
35-
timeout-minutes: 5
35+
timeout-minutes: 3
3636
steps:
3737
- name: "Checkout code"
3838
uses: actions/checkout@v4
39-
- name: "Run unit test suite"
40-
run: |
41-
make test-unit
42-
- name: "Save the result of fast test suite"
43-
run: |
44-
echo "Nothing to save"
45-
test-lint:
46-
name: "Linting"
47-
runs-on: ubuntu-latest
48-
timeout-minutes: 5
49-
steps:
50-
- name: "Checkout code"
51-
uses: actions/checkout@v4
52-
- name: "Run linting"
53-
run: |
54-
make test-lint
55-
- name: "Save the linting result"
56-
run: |
57-
echo "Nothing to save"
58-
test-coverage:
59-
name: "Test coverage"
60-
needs: [test-unit]
61-
runs-on: ubuntu-latest
62-
timeout-minutes: 5
63-
steps:
64-
- name: "Checkout code"
65-
uses: actions/checkout@v4
66-
- name: "Run test coverage check"
67-
run: |
68-
make test-coverage
69-
- name: "Save the coverage check result"
70-
run: |
71-
echo "Nothing to save"
72-
perform-static-analysis:
73-
name: "Perform static analysis"
74-
needs: [test-unit]
75-
runs-on: ubuntu-latest
76-
permissions:
77-
id-token: write
78-
contents: read
79-
timeout-minutes: 5
80-
steps:
81-
- name: "Checkout code"
82-
uses: actions/checkout@v4
83-
with:
84-
fetch-depth: 0 # Full history is needed to improving relevancy of reporting
85-
- name: "Perform static analysis"
86-
uses: ./.github/actions/perform-static-analysis
87-
with:
88-
sonar_organisation_key: "${{ vars.SONAR_ORGANISATION_KEY }}"
89-
sonar_project_key: "${{ vars.SONAR_PROJECT_KEY }}"
90-
sonar_token: "${{ secrets.SONAR_TOKEN }}"
39+
- name: "Run Util Tests"
40+
uses: ./.github/actions/run-util-tests

.github/workflows/stage-3-build.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)