Skip to content

Commit 4d5ffd0

Browse files
authored
Merge branch 'master' into fix-release-step
2 parents abf536e + 6390075 commit 4d5ffd0

1 file changed

Lines changed: 37 additions & 29 deletions

File tree

.github/workflows/pipeline.yaml

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ jobs:
138138
- name: Configure AWS Namespace
139139
env:
140140
PR_NUMBER: ${{ github.event.number }}
141-
# This is the branch name, or the git tag name
142141
NS_BRANCH_OR_TAG: ${{ github.ref_name }}
143142
run: |
144143
echo "PR_NUMBER=${{ env.PR_NUMBER }}"
@@ -161,8 +160,6 @@ jobs:
161160
test $(shasum -a 256 ./dce_linux_amd64.zip | awk '{print $1}') == "${expected_sha}"
162161
unzip ./dce_linux_amd64.zip -d ./
163162
164-
# Lease a DCE account, to use for deploying our PR environment
165-
# (deploy DCE in DCE)
166163
- name: Lease DCE Account
167164
env:
168165
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -201,18 +198,16 @@ jobs:
201198
./dce --config=dce.yml leases login ${lease_id}
202199
echo "${lease_id}" > ./lease_id.txt
203200
204-
# Install Terraform
205201
- name: Install Terraform
206202
uses: hashicorp/setup-terraform@v2
207203
with:
208204
terraform_version: ${{ inputs.terraform_version }}
209205

210-
# Configure the Terraform backend
211206
- name: Configure Terraform Backend
212207
run: |
213208
lease_id=$(cat lease_id.txt)
214209
./scripts/create-tf-backend.sh ${lease_id}
215-
# terraform init
210+
216211
- name: Terraform Init/Apply
217212
env:
218213
NAMESPACE: ${{ env.namespace }}
@@ -223,7 +218,7 @@ jobs:
223218
set -ex
224219
cd modules
225220
terraform init -input=false
226-
221+
227222
export TF_VAR_global_tags='${{ vars.TF_VAR_GLOBAL_TAGS}}'
228223
export TF_VAR_required_bucket_prefix="${TF_VAR_required_bucket_prefix}"
229224
@@ -245,6 +240,41 @@ jobs:
245240
246241
- name: Build artifacts
247242
run: ./scripts/build.sh
243+
244+
- name: Validate Build Artifacts
245+
run: |
246+
echo "Validating build artifacts..."
247+
[ -f "./bin/build_artifacts.zip" ] && echo "build_artifacts.zip created" || (echo "build_artifacts.zip missing" && exit 1)
248+
[ -f "./bin/terraform_artifacts.zip" ] && echo "terraform_artifacts.zip created" || (echo "terraform_artifacts.zip missing" && exit 1)
249+
[ -f "./scripts/deploy.sh" ] && echo "deploy.sh exists" || (echo "deploy.sh missing" && exit 1)
250+
[ -f "./scripts/restore_db.sh" ] && echo "restore_db.sh exists" || (echo "restore_db.sh missing" && exit 1)
251+
252+
# Validate file sizes
253+
build_size=$(stat -c%s "./bin/build_artifacts.zip" 2>/dev/null || echo "0")
254+
terraform_size=$(stat -c%s "./bin/terraform_artifacts.zip" 2>/dev/null || echo "0")
255+
256+
[ "$build_size" -gt 0 ] && echo "build_artifacts.zip has content ($build_size bytes)" || (echo "build_artifacts.zip is empty" && exit 1)
257+
[ "$terraform_size" -gt 0 ] && echo "terraform_artifacts.zip has content ($terraform_size bytes)" || (echo "terraform_artifacts.zip is empty" && exit 1)
258+
259+
- name: Upload Build Artifacts for Release
260+
uses: actions/upload-artifact@v4
261+
with:
262+
name: release_build_artifacts
263+
path: ./bin/build_artifacts.zip
264+
265+
- name: Upload Terraform Artifacts for Release
266+
uses: actions/upload-artifact@v4
267+
with:
268+
name: release_terraform_artifacts
269+
path: ./bin/terraform_artifacts.zip
270+
271+
- name: Upload Deploy Scripts for Release
272+
uses: actions/upload-artifact@v4
273+
with:
274+
name: release_deploy_scripts
275+
path: |
276+
./scripts/deploy.sh
277+
./scripts/restore_db.sh
248278
249279
- name: DCE Lease Login
250280
env:
@@ -313,26 +343,6 @@ jobs:
313343
"${NAMESPACE}" \
314344
"${ARTIFACTS_BUCKET}"
315345
316-
# Functional Tests --> TODO need to fix the test failures
317-
318-
# - name: Functional Tests
319-
# run: |
320-
# set -euxo pipefail
321-
# mkdir -p junit-report
322-
323-
# go get github.com/jstemmer/go-junit-report
324-
# go test -v ./tests/... -test.timeout 50m 2>&1 | tee >(go-junit-report > junit-report/functional.xml)
325-
326-
# Publish junit test results (for unit and functional tests) -- > TODO need to fix the test failures
327-
328-
# - name: Publish Test Results
329-
# if: always()
330-
# uses: actions/upload-artifact@v4
331-
# with:
332-
# name: Functional-Test-Results
333-
# path: junit-report/functional.xml
334-
# retention-days: 7
335-
336346
- name: Upload dce-cli Artifact
337347
uses: actions/upload-artifact@v4
338348
with:
@@ -397,7 +407,6 @@ jobs:
397407
cp ${{ github.workspace }}/backend-tf/backend.tf ./modules/
398408
chmod +x ./dce
399409
400-
# Cleanup the PR environment
401410
- name: Terraform for Cleanup
402411
uses: hashicorp/setup-terraform@v2
403412
with:
@@ -419,7 +428,6 @@ jobs:
419428
terraform init -input=false
420429
terraform destroy -auto-approve
421430
422-
# End the DCE lease
423431
- name: End DCE Lease
424432
env:
425433
AWS_DEFAULT_REGION: us-east-1

0 commit comments

Comments
 (0)