Skip to content

IPA Validation Metrics Release #61

IPA Validation Metrics Release

IPA Validation Metrics Release #61

# 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: 'v2.json'
jobs:
# Generates and uploads the IPA validation metrics to S3
release-IPA-metrics:
name: Release IPA Validation Metrics
runs-on: ubuntu-latest
steps:
- name: Fetch OAS file from Dev Branch
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: ${{ env.OAS_BRANCH }}
sparse-checkout: openapi/${{ env.OAS_FILE }}
- name: Debug Checkout
run: |
echo "Workspace Contents:"
ls -la
- name: Upload OAS file
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
name: oas-dev
path: openapi/${{ env.OAS_FILE }}
- name: Checkout repository (scripts)
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
sparse-checkout: |
tools/spectral/ipa
package.json
package-lock.json
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install npm dependencies
run: npm install
- name: Download oas-dev
uses: actions/download-artifact@v4
with:
name: oas-dev
- 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: Run Metric Collection Job
working-directory: tools/spectral/ipa/metrics/scripts
run: ls -la
# node runMetricCollection.js ${{ env.OAS_FILE }}
# - 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 }}