๐๏ธ DOP-5399 adds ast files #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Coverage Check for Osiris Generated AST files | |
on: | |
pull_request: | |
paths: | |
- '**/*.ast' # Only trigger if .ast files are changed | |
branches: | |
- main | |
- DOP-5399-CB | |
jobs: | |
check-coverage: | |
runs-on: ubuntu-latest | |
outputs: | |
site_coverage_list: ${{ steps.set_coverage.outputs.site_coverage_list }} | |
coverage_below_threshold: ${{ steps.set_coverage.outputs.coverage_below_threshold }} | |
steps: | |
- name: Checkout Repos | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.API_TOKEN_GITHUB }} | |
fetch-depth: 0 | |
ref: DOP-5399-CB | |
- name: Verify Branch Checkout | |
run: | | |
git branch --show-current # Print the current branch | |
- name: Install Wget | |
run: sudo apt-get update && sudo apt-get install -y wget | |
- name: Clone Osiris | |
run: git clone https://x-access-token:${{ secrets.API_TOKEN_GITHUB }}@github.com/10gen/osiris.git cloned-osiris-repo | |
- name: Run Coverage Check | |
id: run_coverage | |
uses: mongodb/docs-worker-actions/coverage-check@DOP-5399 | |
with: | |
repo-path: cloned-osiris-repo | |
required-coverage: '100' | |
- name: Set Workflow Outputs | |
id: set_coverage | |
run: | | |
echo "coverage_below_threshold=${coverage_below_threshold}" >> $GITHUB_OUTPUT | |
echo "site_coverage_list=${SITE_COVERAGE_LIST}" >> $GITHUB_OUTPUT | |
send-slack-notification: | |
runs-on: ubuntu-latest | |
needs: check-coverage | |
if: needs.check-coverage.outputs.coverage_below_threshold == 'true' | |
steps: | |
- name: Send Slack Notification | |
env: | |
SITE_COVERAGE_LIST: ${{ needs.check-coverage.outputs.site_coverage_list }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
REPOSITORY: ${{ github.repository }} | |
PR_TITLE: ${{ github.event.pull_request.title }} | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
PR_URL: ${{ github.event.pull_request.html_url }} | |
PR_SHA: ${{ github.event.pull_request.head.sha }} | |
uses: mongodb/docs-worker-actions/coverage-report-to-slack@DOP-5399 | |
with: | |
required-coverage: '100' | |
site-coverage-list: $SITE_COVERAGE_LIST | |
slack-webhook-url: $SLACK_WEBHOOK_URL | |
repository: $REPOSITORY | |
pr-title: $PR_TITLE | |
pr-number: $PR_NUMBER | |
pr-url: $PR_URL | |
pr-sha: $PR_SHA |