Skip to content

Commit 785e7b2

Browse files
committed
feat: consolidate github actions
1 parent e557d0d commit 785e7b2

17 files changed

Lines changed: 112 additions & 424 deletions

.github/workflows/ci-ui-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
working-directory: application/CohortManager/src/Web
1717

1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v6
2020

2121
- name: Setup Node.js
2222
uses: actions/setup-node@v4

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
terraform_version: ${{ steps.variables.outputs.terraform_version }}
2626
environment_tag: ${{ steps.variables.outputs.environment_tag }}
2727
version: ${{ steps.variables.outputs.version }}
28-
does_pull_request_exist: ${{ steps.pr_exists.outputs.does_pull_request_exist }}
28+
does_pull_request_exist: ${{ steps.pr.outputs.does_pull_request_exist }}
2929
steps:
3030
- name: "Checkout code"
31-
uses: actions/checkout@v4
31+
uses: actions/checkout@v6
3232
with:
3333
submodules: 'true'
3434
- name: "Set CI/CD variables"
@@ -46,7 +46,7 @@ jobs:
4646
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
4747
echo "environment_tag=development" >> $GITHUB_OUTPUT
4848
- name: "Check if pull request exists for this branch"
49-
id: pr_exists
49+
id: pr
5050
env:
5151
GH_TOKEN: ${{ github.token }}
5252
run: |
@@ -70,7 +70,7 @@ jobs:
7070
export TERRAFORM_VERSION="${{ steps.variables.outputs.terraform_version }}"
7171
export ENVIRONMENT_TAG="${{ steps.variables.outputs.environment_tag }}"
7272
export VERSION="${{ steps.variables.outputs.version }}"
73-
export DOES_PULL_REQUEST_EXIST="${{ steps.pr_exists.outputs.does_pull_request_exist }}"
73+
export DOES_PULL_REQUEST_EXIST="${{ steps.pr.outputs.does_pull_request_exist }}"
7474
make list-variables
7575
commit-stage: # Recommended maximum execution time is 2 minutes
7676
name: "Commit stage"
@@ -143,19 +143,6 @@ jobs:
143143
function_app_source_code_path: application/CohortManager/src
144144
project_name: cohort-manager
145145
build_all_images: true
146-
acceptance-stage: # Recommended maximum execution time is 10 minutes
147-
name: "Acceptance stage"
148-
needs: [metadata, build-image-stage]
149-
uses: ./.github/workflows/stage-4-acceptance.yaml
150-
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened'))
151-
with:
152-
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
153-
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
154-
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
155-
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
156-
python_version: "${{ needs.metadata.outputs.python_version }}"
157-
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
158-
version: "${{ needs.metadata.outputs.version }}"
159146
deploy-stage:
160147
if: github.event_name == 'push'
161148
name: Deploy DevTest environment for commit ${{ github.sha }}

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

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929
terraform_version: ${{ steps.variables.outputs.terraform_version }}
3030
environment_tag: ${{ steps.variables.outputs.environment_tag }}
3131
version: ${{ steps.variables.outputs.version }}
32-
does_pull_request_exist: ${{ steps.pr_exists.outputs.does_pull_request_exist }}
32+
does_pull_request_exist: ${{ steps.pr.outputs.does_pull_request_exist }}
3333
steps:
3434
- name: "Checkout code"
35-
uses: actions/checkout@v4
35+
uses: actions/checkout@v6
3636
with:
3737
submodules: 'true'
3838
- name: "Set CI/CD variables"
@@ -47,10 +47,10 @@ jobs:
4747
echo "nodejs_version=$(grep "^nodejs" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
4848
echo "python_version=$(grep "^nodejs" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
4949
echo "terraform_version=$(grep "^terraform" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
50-
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
5150
echo "environment_tag=development" >> $GITHUB_OUTPUT
51+
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
5252
- name: "Check if pull request exists for this branch"
53-
id: pr_exists
53+
id: pr
5454
env:
5555
GH_TOKEN: ${{ github.token }}
5656
run: |
@@ -74,7 +74,7 @@ jobs:
7474
export TERRAFORM_VERSION="${{ steps.variables.outputs.terraform_version }}"
7575
export ENVIRONMENT_TAG="${{ steps.variables.outputs.environment_tag }}"
7676
export VERSION="${{ steps.variables.outputs.version }}"
77-
export DOES_PULL_REQUEST_EXIST="${{ steps.pr_exists.outputs.does_pull_request_exist }}"
77+
export DOES_PULL_REQUEST_EXIST="${{ steps.pr.outputs.does_pull_request_exist }}"
7878
make list-variables
7979
commit-stage: # Recommended maximum execution time is 2 minutes
8080
name: "Commit stage"
@@ -148,19 +148,6 @@ jobs:
148148
function_app_source_code_path: application/CohortManager/src
149149
project_name: cohort-manager
150150
build_all_images: true
151-
acceptance-stage: # Recommended maximum execution time is 10 minutes
152-
name: "Acceptance stage"
153-
needs: [metadata, build-image-stage]
154-
uses: ./.github/workflows/stage-4-acceptance.yaml
155-
if: needs.metadata.outputs.does_pull_request_exist == 'true' || (github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'reopened'))
156-
with:
157-
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
158-
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
159-
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
160-
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
161-
python_version: "${{ needs.metadata.outputs.python_version }}"
162-
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
163-
version: "${{ needs.metadata.outputs.version }}"
164151
deploy-stage:
165152
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
166153
name: Deploy environments for commit ${{ github.sha }}

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

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

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

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
timeout-minutes: 2
4040
steps:
4141
- name: "Checkout code"
42-
uses: actions/checkout@v4
42+
uses: actions/checkout@v6
4343
with:
4444
fetch-depth: 0 # Full history is needed to scan all commits
4545
submodules: 'true'
@@ -54,7 +54,7 @@ jobs:
5454
timeout-minutes: 2
5555
steps:
5656
- name: "Checkout code"
57-
uses: actions/checkout@v4
57+
uses: actions/checkout@v6
5858
with:
5959
fetch-depth: 0 # Full history is needed to compare branches
6060
- name: "Check file format"
@@ -65,7 +65,7 @@ jobs:
6565
timeout-minutes: 2
6666
steps:
6767
- name: "Checkout code"
68-
uses: actions/checkout@v4
68+
uses: actions/checkout@v6
6969
with:
7070
fetch-depth: 0 # Full history is needed to compare branches
7171
- name: "Check Markdown format"
@@ -76,7 +76,7 @@ jobs:
7676
timeout-minutes: 2
7777
steps:
7878
- name: "Checkout code"
79-
uses: actions/checkout@v4
79+
uses: actions/checkout@v6
8080
with:
8181
fetch-depth: 0 # Full history is needed to compare branches
8282
- name: "Check English usage"
@@ -87,7 +87,7 @@ jobs:
8787
timeout-minutes: 2
8888
steps:
8989
- name: "Checkout code"
90-
uses: actions/checkout@v4
90+
uses: actions/checkout@v6
9191
- name: "Lint Terraform"
9292
uses: ./.github/actions/lint-terraform
9393
count-lines-of-code:
@@ -99,24 +99,9 @@ jobs:
9999
timeout-minutes: 2
100100
steps:
101101
- name: "Checkout code"
102-
uses: actions/checkout@v4
102+
uses: actions/checkout@v6
103103
- name: "Count lines of code"
104104
uses: ./.github/actions/create-lines-of-code-report
105105
with:
106106
build_datetime: "${{ inputs.build_datetime }}"
107107
build_timestamp: "${{ inputs.build_timestamp }}"
108-
scan-dependencies:
109-
name: "Scan dependencies"
110-
runs-on: ubuntu-latest
111-
permissions:
112-
id-token: write
113-
contents: read
114-
timeout-minutes: 2
115-
steps:
116-
- name: "Checkout code"
117-
uses: actions/checkout@v4
118-
# - name: "Scan dependencies"
119-
# uses: ./.github/actions/scan-dependencies
120-
# with:
121-
# build_datetime: "${{ inputs.build_datetime }}"
122-
# build_timestamp: "${{ inputs.build_timestamp }}"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
timeout-minutes: 15
5252
steps:
5353
- name: Checkout code
54-
uses: actions/checkout@v4
54+
uses: actions/checkout@v6
5555
with:
5656
submodules: true
5757
fetch-depth: 0

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

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
UNIT_TEST_DIR: ${{ inputs.unit_test_dir }}
6464
steps:
6565
- name: Checkout code
66-
uses: actions/checkout@v4
66+
uses: actions/checkout@v6
6767
with:
6868
submodules: true
6969
- name: Check for ConsolidatedTests.csproj
@@ -89,7 +89,7 @@ jobs:
8989
UNIT_TEST_DIR: ${{ inputs.unit_test_dir }}
9090
steps:
9191
- name: Checkout code
92-
uses: actions/checkout@v4
92+
uses: actions/checkout@v6
9393
with:
9494
submodules: true
9595
- name: Create matrix for parallel jobs
@@ -112,7 +112,7 @@ jobs:
112112
LOGGER_FORMAT: ${{ inputs.unit_test_logger_format }}
113113
steps:
114114
- name: Checkout code
115-
uses: actions/checkout@v4
115+
uses: actions/checkout@v6
116116
with:
117117
submodules: true
118118
- name: Setup .NET
@@ -162,7 +162,7 @@ jobs:
162162
LOGGER_FORMAT: ${{ inputs.unit_test_logger_format }}
163163
steps:
164164
- name: Checkout code
165-
uses: actions/checkout@v4
165+
uses: actions/checkout@v6
166166
with:
167167
submodules: true
168168
- name: Setup .NET
@@ -209,7 +209,7 @@ jobs:
209209
pull-requests: write
210210
steps:
211211
- name: Checkout code
212-
uses: actions/checkout@v4
212+
uses: actions/checkout@v6
213213
with:
214214
submodules: true
215215
- name: Setup .NET
@@ -252,17 +252,3 @@ jobs:
252252
coverage-type: cobertura
253253
coverage-path: coverage/Cobertura.xml
254254
# coverage-threshold: 50
255-
256-
test-lint:
257-
name: Linting
258-
runs-on: ubuntu-latest
259-
timeout-minutes: 5
260-
steps:
261-
- name: Checkout code
262-
uses: actions/checkout@v4
263-
- name: Run linting
264-
run: |
265-
make test-lint
266-
- name: Save the linting result
267-
run: |
268-
echo "Nothing to save"

0 commit comments

Comments
 (0)