Skip to content

Commit 80b7a18

Browse files
CLOUDP-290416: [Product Metrics/Observability] Set up Github Action for IPA metrics collection job
1 parent 08a8b33 commit 80b7a18

File tree

2 files changed

+66
-1
lines changed

2 files changed

+66
-1
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: IPA Validations Release
2+
on:
3+
workflow_call:
4+
secrets: # all secrets are passed explicitly in this workflow
5+
aws_access_key:
6+
required: true
7+
aws_secret_key:
8+
required: true
9+
aws_s3_bucket_prefix:
10+
required: true
11+
workflow_dispatch:
12+
permissions:
13+
issues: write
14+
15+
jobs:
16+
release-IPA-validation:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20.x'
26+
cache: 'npm'
27+
28+
- name: Install npm dependencies
29+
run: npm install
30+
31+
- name: Check last Changelog Entry
32+
id: check_last_run
33+
run: |
34+
last_run_date=$(< changelog/changelog.json jq '.[0].date')
35+
today=$(date +%F)
36+
echo "last_run_date=${last_run_date}"
37+
echo "today=${today}"
38+
if [[ "${last_run_date}" == "${today}" ]]; then
39+
echo "skip_release='true'" >> "${GITHUB_OUTPUT}"
40+
else
41+
echo "skip_release='false'" >> "${GITHUB_OUTPUT}"
42+
fi
43+
44+
- name: Run Metric Collection Job
45+
working-directory: ./tools/spectral/ipa/metrics
46+
run: node metricCollection.js
47+
48+
- name: Dump Metric Collection Job Data to S3
49+
working-directory: ./tools/spectral/ipa/metrics
50+
env:
51+
AWS_ACCESS_KEY_ID: ${{secrets.aws_access_key}}
52+
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_key }}
53+
S3_BUCKET_PREFIX: ${{ secrets.aws_s3_bucket_prefix }}
54+
run: node dataDump.js
55+

.github/workflows/release-spec.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,19 @@ jobs:
178178
branch: ${{ inputs.branch }}
179179
foascli_version: ${{ inputs.foascli_version }}
180180

181+
# release-IPA-validation:
182+
# name: Release IPA validations
183+
# needs: release
184+
# if: ${{ inputs.env == 'dev' && needs.release.outputs.changes_detected == 'true' }}
185+
# uses: ./.github/workflows/release-IPA-validation.yml
186+
# secrets:
187+
# aws_access_key: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_USERNAME}}
188+
# aws_secret_key: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PASSWORD}}
189+
# aws_s3_bucket_prefix: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PREFIX}}
190+
181191
failure-handler:
182192
name: Failure Handler
183-
needs: [ release, release-postman, release-changelog ]
193+
needs: [ release, release-postman, release-changelog, release-IPA-validation ]
184194
if: ${{ always() && contains(needs.*.result, 'failure') }}
185195
uses: ./.github/workflows/failure-handler.yml
186196
with:

0 commit comments

Comments
 (0)