Skip to content

Commit 90c0b9a

Browse files
CCM-13478: Improve Pipeline Times (#191)
* CCM-13478: Initial commit with various improvements * CCM-13478: Further changes * CCM-13478: Fix npm ci * CCM-13478: Add read permission * CCM-13478: Componenet test parallel test * CCM-13478: Update lint/typecheck * CCM-13478: Revert typecheck change * CCM-13478: Revert parallel change * CCM-13478: Add read permission to schema check * CCM-13478: Fix missing permission * CCM-13478: Remove echo steps and increase workers * CCM-13478: Increase workers to 35 * CCM-13478: Reset workers to 8
1 parent 60ff384 commit 90c0b9a

8 files changed

Lines changed: 72 additions & 76 deletions

File tree

.github/actions/acceptance-tests/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ runs:
3434
with:
3535
node-version: ${{ steps.nodejs_version.outputs.nodejs_version }}
3636
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
37-
- name: "Repo setup"
37+
- name: "Install dependencies"
3838
shell: bash
3939
run: |
4040
npm ci

.github/actions/build-docs/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ runs:
2727
uses: ruby/setup-ruby@v1.267.0
2828
with:
2929
ruby-version: "3.4.7" # Not needed with a .ruby-version file
30-
bundler-cache: false # runs 'bundle install' and caches installed gems automatically
31-
#cache-version: 0 # Increment this number if you need to re-download cached gems
30+
bundler-cache: true # Enable automatic gem caching
31+
cache-version: 0 # Increment this number if you need to re-download cached gems
3232
working-directory: "./docs"
3333
- name: Setup Pages
3434
id: pages

.github/actions/node-install/action.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ runs:
1616
uses: actions/setup-node@v6
1717
with:
1818
node-version: '${{ inputs.node-version }}'
19+
cache: 'npm'
20+
cache-dependency-path: '**/package-lock.json'
1921

2022
- name: "Configure npm for GitHub Packages"
2123
shell: bash

.github/workflows/stage-1-commit.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ jobs:
5555
steps:
5656
- name: "Checkout code"
5757
uses: actions/checkout@v5
58-
with:
59-
fetch-depth: 0 # Full history is needed to compare branches
6058
- name: "Check file format"
6159
uses: ./.github/actions/check-file-format
6260
check-markdown-format:
@@ -66,8 +64,6 @@ jobs:
6664
steps:
6765
- name: "Checkout code"
6866
uses: actions/checkout@v5
69-
with:
70-
fetch-depth: 0 # Full history is needed to compare branches
7167
- name: "Check Markdown format"
7268
uses: ./.github/actions/check-markdown-format
7369
terraform-docs:
@@ -101,8 +97,6 @@ jobs:
10197
steps:
10298
- name: "Checkout code"
10399
uses: actions/checkout@v5
104-
with:
105-
fetch-depth: 0 # Full history is needed to compare branches
106100
- name: "Check English usage"
107101
uses: ./.github/actions/check-english-usage
108102
check-todo-usage:
@@ -112,8 +106,6 @@ jobs:
112106
steps:
113107
- name: "Checkout code"
114108
uses: actions/checkout@v5
115-
with:
116-
fetch-depth: 0 # Full history is needed to compare branches
117109
- name: "Check TODO usage"
118110
uses: ./.github/actions/check-todo-usage
119111
detect-terraform-changes:

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

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,34 @@ env:
4141
TERM: xterm-256color
4242

4343
jobs:
44+
detect-schema-changes:
45+
name: "Detect Schema Changes"
46+
runs-on: ubuntu-latest
47+
permissions:
48+
contents: read
49+
outputs:
50+
schemas_changed: ${{ steps.filter.outputs.schemas }}
51+
steps:
52+
- name: "Checkout code"
53+
uses: actions/checkout@v5
54+
55+
- name: "Check for schema changes"
56+
uses: dorny/paths-filter@v3
57+
id: filter
58+
with:
59+
filters: |
60+
schemas:
61+
- 'src/cloudevents/**'
62+
- 'src/typescript-schema-generator/**'
63+
- 'src/python-schema-generator/**'
64+
- 'src/digital-letters-events/**'
65+
4466
check-generated-dependencies:
4567
name: "Check generated dependencies"
68+
needs: [detect-schema-changes]
69+
if: needs.detect-schema-changes.outputs.schemas_changed == 'true'
4670
runs-on: ubuntu-latest
47-
timeout-minutes: 5
71+
timeout-minutes: 4
4872
permissions:
4973
contents: read
5074
packages: read
@@ -80,6 +104,8 @@ jobs:
80104
uses: actions/setup-python@v6
81105
with:
82106
python-version: ${{ inputs.python_version }}
107+
cache: 'pip'
108+
cache-dependency-path: '**/requirements*.txt'
83109
- name: "Run unit test suite"
84110
run: |
85111
make test-unit
@@ -106,7 +132,7 @@ jobs:
106132
test-lint:
107133
name: "Linting"
108134
runs-on: ubuntu-latest
109-
timeout-minutes: 5
135+
timeout-minutes: 4
110136
permissions:
111137
contents: read
112138
packages: read
@@ -117,6 +143,8 @@ jobs:
117143
uses: actions/setup-python@v6
118144
with:
119145
python-version: ${{ inputs.python_version }}
146+
cache: 'pip'
147+
cache-dependency-path: '**/requirements*.txt'
120148
- uses: ./.github/actions/node-install
121149
with:
122150
node-version: ${{ inputs.nodejs_version }}
@@ -127,7 +155,7 @@ jobs:
127155
test-typecheck:
128156
name: "Typecheck"
129157
runs-on: ubuntu-latest
130-
timeout-minutes: 5
158+
timeout-minutes: 4
131159
permissions:
132160
contents: read
133161
packages: read
@@ -143,30 +171,14 @@ jobs:
143171
- name: "Run typecheck"
144172
run: |
145173
make test-typecheck
146-
test-coverage:
147-
name: "Test coverage"
148-
needs: [test-unit]
149-
runs-on: ubuntu-latest
150-
timeout-minutes: 5
151-
permissions:
152-
contents: read
153-
steps:
154-
- name: "Checkout code"
155-
uses: actions/checkout@v5
156-
- name: "Run test coverage check"
157-
run: |
158-
make test-coverage
159-
- name: "Save the coverage check result"
160-
run: |
161-
echo "Nothing to save"
162174
perform-static-analysis:
163175
name: "Perform static analysis"
164176
needs: [test-unit]
165177
runs-on: ubuntu-latest
166178
permissions:
167179
id-token: write
168180
contents: read
169-
timeout-minutes: 5
181+
timeout-minutes: 4
170182
steps:
171183
- name: "Checkout code"
172184
uses: actions/checkout@v5

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,45 @@ on:
3333
type: string
3434

3535
jobs:
36+
detect-doc-changes:
37+
name: "Detect Documentation Changes"
38+
runs-on: ubuntu-latest
39+
permissions:
40+
contents: read
41+
outputs:
42+
docs_changed: ${{ steps.filter.outputs.docs }}
43+
schemas_changed: ${{ steps.filter.outputs.schemas }}
44+
eventcatalog_changed: ${{ steps.filter.outputs.eventcatalog }}
45+
steps:
46+
- name: "Checkout code"
47+
uses: actions/checkout@v5
48+
49+
- name: "Check for relevant changes"
50+
uses: dorny/paths-filter@v3
51+
id: filter
52+
with:
53+
filters: |
54+
docs:
55+
- 'docs/**'
56+
schemas:
57+
- 'src/cloudevents/**'
58+
- 'src/cloudeventjekylldocs/**'
59+
eventcatalog:
60+
- 'src/eventcatalog/**'
61+
- 'src/asyncapigenerator/**'
62+
- 'src/eventcatalogasyncapiimporter/**'
63+
3664
artefact-jekyll-docs:
3765
name: "Build Docs"
66+
needs: [detect-doc-changes]
67+
if: |
68+
needs.detect-doc-changes.outputs.docs_changed == 'true' ||
69+
needs.detect-doc-changes.outputs.schemas_changed == 'true' ||
70+
needs.detect-doc-changes.outputs.eventcatalog_changed == 'true'
3871
runs-on: ubuntu-latest
3972
timeout-minutes: 15
73+
permissions:
74+
contents: read
4075
steps:
4176
- name: "Checkout code"
4277
uses: actions/checkout@v5

.github/workflows/stage-4-acceptance.yaml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,9 @@ on:
2222
type: string
2323

2424
jobs:
25-
environment-set-up:
26-
name: "Environment set up"
27-
runs-on: ubuntu-latest
28-
timeout-minutes: 5
29-
steps:
30-
- name: "Checkout code"
31-
uses: actions/checkout@v5
32-
- name: "Create infractructure"
33-
run: |
34-
echo "Creating infractructure..."
35-
- name: "Update database"
36-
run: |
37-
echo "Updating database..."
38-
- name: "Deploy application"
39-
run: |
40-
echo "Deploying application..."
4125
test-contract:
4226
name: "Contract test"
4327
runs-on: ubuntu-latest
44-
needs: environment-set-up
4528
timeout-minutes: 10
4629
steps:
4730
- name: "Checkout code"
@@ -55,7 +38,6 @@ jobs:
5538
test-security:
5639
name: "Security test"
5740
runs-on: ubuntu-latest
58-
needs: environment-set-up
5941
timeout-minutes: 10
6042
steps:
6143
- name: "Checkout code"
@@ -69,7 +51,6 @@ jobs:
6951
test-ui:
7052
name: "UI test"
7153
runs-on: ubuntu-latest
72-
needs: environment-set-up
7354
timeout-minutes: 10
7455
steps:
7556
- name: "Checkout code"
@@ -83,7 +64,6 @@ jobs:
8364
test-ui-performance:
8465
name: "UI performance test"
8566
runs-on: ubuntu-latest
86-
needs: environment-set-up
8767
timeout-minutes: 10
8868
steps:
8969
- name: "Checkout code"
@@ -97,7 +77,6 @@ jobs:
9777
test-integration:
9878
name: "Integration test"
9979
runs-on: ubuntu-latest
100-
needs: environment-set-up
10180
steps:
10281
- uses: actions/checkout@v5.0.0
10382
# Calls out to the nhs-notify-internal repo.
@@ -122,7 +101,6 @@ jobs:
122101
test-accessibility:
123102
name: "Accessibility test"
124103
runs-on: ubuntu-latest
125-
needs: environment-set-up
126104
timeout-minutes: 10
127105
steps:
128106
- name: "Checkout code"
@@ -136,7 +114,6 @@ jobs:
136114
test-load:
137115
name: "Load test"
138116
runs-on: ubuntu-latest
139-
needs: environment-set-up
140117
timeout-minutes: 10
141118
steps:
142119
- name: "Checkout code"
@@ -147,24 +124,3 @@ jobs:
147124
- name: "Save result"
148125
run: |
149126
echo "Nothing to save"
150-
environment-tear-down:
151-
name: "Environment tear down"
152-
runs-on: ubuntu-latest
153-
needs:
154-
[
155-
test-accessibility,
156-
test-contract,
157-
test-integration,
158-
test-load,
159-
test-security,
160-
test-ui-performance,
161-
test-ui,
162-
]
163-
if: always()
164-
timeout-minutes: 5
165-
steps:
166-
- name: "Checkout code"
167-
uses: actions/checkout@v5
168-
- name: "Tear down environment"
169-
run: |
170-
echo "Tearing down environment..."

scripts/tests/lint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ set -euo pipefail
55
cd "$(git rev-parse --show-toplevel)"
66

77
npm ci
8-
npm run generate-dependencies
98
npm run lint

0 commit comments

Comments
 (0)