-
Notifications
You must be signed in to change notification settings - Fork 12
85 lines (76 loc) · 2.67 KB
/
release-IPA-metrics.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# This workflow will generate metrics about the IPA validation on the current OAS
# (number of adoptions, violations and exceptions) and upload the data to an S3 bucket.
name: IPA Validation Metrics Release
on:
schedule:
- cron: '0 11 * * *' # Runs daily at 11:00 UTC (11 AM UTC)
workflow_dispatch:
permissions:
issues: write
contents: write
env:
NODE_VERSION: '20.x'
OAS_BRANCH: 'dev'
OAS_FILE: 'openapi/v2.json'
DEV_OAS_PATH: ${{ github.workspace }}/dev-oas
jobs:
# Generates and uploads the IPA validation metrics to S3
release-IPA-metrics:
name: Release IPA Validation Metrics
runs-on: ubuntu-latest
steps:
- name: Checkout repository (dev branch)
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: ${{ env.OAS_BRANCH }}
sparse-checkout: ${{ env.OAS_FILE }}
path: dev-oas
- name: Checkout repository (scripts)
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
sparse-checkout:
tools/spectral/ipa
package.json
package-lock.json
- name: Validate OAS file
run: |
if [ ! -f "dev-oas/${{ env.OAS_FILE }}" ]; then
echo "::error::OAS file not found in ${{ env.OAS_BRANCH }} branch"
exit 1
fi
- name: Debug Checkout
run: |
echo "Workspace Contents:"
ls -la
echo "Tools Spectral Contents:"
ls -la tools/spectral
echo "IPA Contents:"
ls -la tools/spectral/ipa || echo "ipa directory is missing!"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install npm dependencies
run: npm install
- name: Run Metric Collection Job
working-directory: tools/spectral/ipa
run: ls -la
# node runMetricCollection.js "${{ env.DEV_OAS_PATH }}/openapi/v2.json"
# - name: Dump Metric Collection Job Data to S3
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_USERNAME }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PASSWORD }}
# S3_BUCKET_PREFIX: ${{ secrets.IPA_S3_BUCKET_DW_STAGING_PREFIX }}
# working-directory: tools/spectral/ipa/metrics/scripts
# run: node dataDump.js
# failure-handler:
# name: Failure Handler
# needs: [ release-IPA-metrics ]
# if: ${{ failure() }}
# uses: ./.github/workflows/failure-handler.yml
# with:
# env: ${{ env.OAS_BRANCH }}
# release_name: "IPA Metrics"
# secrets:
# jira_api_token: ${{ secrets.JIRA_API_TOKEN }}