Skip to content

Commit 16d0b82

Browse files
authored
Merge pull request #638 from mongodb/DOP-5399-CB
👷 DOP-5399 adds Osiris Coverage GHA
2 parents 5a3f648 + ea395d1 commit 16d0b82

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed

.github/workflows/add-netlify-links.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Add Netlify Links To Changed Pages
22
on:
33
workflow_call:
44
pull_request_target:
5+
paths-ignore:
6+
- "source/**/*.ast"
57
jobs:
68
get-pr-changes:
79
name: Get Changed Files & Update PR Description
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Coverage Check for Osiris Generated AST files
2+
on:
3+
pull_request:
4+
paths:
5+
- '**/*.ast' # Only trigger if .ast files are changed
6+
branches:
7+
- main
8+
9+
jobs:
10+
check-coverage:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
site_coverage_list: ${{ steps.set_coverage.outputs.site_coverage_list }}
14+
coverage_below_threshold: ${{ steps.set_coverage.outputs.coverage_below_threshold }}
15+
16+
steps:
17+
- name: Checkout Repos
18+
uses: actions/checkout@v4
19+
# uncomment when running or testing locally using [act](https://github.com/nektos/act?tab=readme-ov-file)
20+
# with:
21+
# token: ${{ secrets.API_TOKEN_GITHUB }}
22+
# ref: DOP-5399-placeholder
23+
24+
- name: Verify Branch Checkout
25+
run: |
26+
git branch --show-current # Print the current branch
27+
28+
- name: Install Wget
29+
run: sudo apt-get update && sudo apt-get install -y wget
30+
31+
- name: Clone Osiris
32+
run: git clone https://x-access-token:${{ secrets.API_TOKEN_GITHUB }}@github.com/10gen/osiris.git cloned-osiris-repo
33+
34+
- name: Run Coverage Check
35+
id: run_coverage
36+
uses: mongodb/docs-worker-actions/coverage-check@main
37+
with:
38+
repo-path: cloned-osiris-repo
39+
required-coverage: '90'
40+
41+
- name: Set Workflow Outputs
42+
id: set_coverage
43+
run: |
44+
echo "coverage_below_threshold=${coverage_below_threshold}" >> $GITHUB_OUTPUT
45+
echo "site_coverage_list=${SITE_COVERAGE_LIST}" >> $GITHUB_OUTPUT
46+
47+
send-slack-notification:
48+
runs-on: ubuntu-latest
49+
needs: check-coverage
50+
if: needs.check-coverage.outputs.coverage_below_threshold == 'true'
51+
52+
steps:
53+
- name: Send Slack Notification
54+
env:
55+
SITE_COVERAGE_LIST: ${{ needs.check-coverage.outputs.site_coverage_list }}
56+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
57+
REPOSITORY: ${{ github.repository }}
58+
PR_TITLE: ${{ github.event.pull_request.title }}
59+
PR_NUMBER: ${{ github.event.pull_request.number }}
60+
PR_URL: ${{ github.event.pull_request.html_url }}
61+
PR_SHA: ${{ github.event.pull_request.head.sha }}
62+
uses: mongodb/docs-worker-actions/coverage-report-to-slack@main
63+
with:
64+
required-coverage: '90'
65+
site-coverage-list: $SITE_COVERAGE_LIST
66+
slack-webhook-url: $SLACK_WEBHOOK_URL
67+
repository: $REPOSITORY
68+
pr-title: $PR_TITLE
69+
pr-number: $PR_NUMBER
70+
pr-url: $PR_URL
71+
pr-sha: $PR_SHA

.github/workflows/vale-tdbx.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
pull_request:
44
paths:
55
- "source/**"
6+
paths-ignore:
7+
- "source/**/*.ast"
68

79
jobs:
810
vale:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ giza.log
3434
.vscode*
3535
*.swp
3636
*.code-workspace
37+
38+
# GitHub Actions
39+
.secrets
40+
event.json

0 commit comments

Comments
 (0)