Skip to content

Commit

Permalink
chore: Added updating of docs site with compat table
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed May 21, 2024
1 parent fcb285a commit b4b424a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 40 deletions.
50 changes: 13 additions & 37 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,25 @@ jobs:
permissions:
pull-requests: read
outputs:
javascript_changed: ${{ steps.filter.output.javascript }}
javascript_changed: ${{ steps.filter.outputs.javascript }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
javascript:
- '**/*.js'
- '**/*.json'
- '**/*.mjs'
- '**/*.cjs'
skip_if_release:
runs-on: ubuntu-latest

outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}

steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
paths_ignore: '["NEWS.md", "changelog.json", "package.json", "package-lock.json"]'
skip_after_successful_duplicate: false
do_not_skip: '["workflow_dispatch", "pull_request"]'
- 'api.js'
- 'esm-loader.mjs'
- 'index.js'
- 'stub_api.js'
- 'lib/**/*.{js,json,mjs,cjs}'
- 'test/**/*.{js,json,mjs,cjs}'
lint:
needs:
- skip_if_release
- should_run
if: needs.skip_if_release.outputs.should_skip != 'true'
|| needs.should_run.outputs.javascript_changed == 'true'
if: needs.should_run.outputs.javascript_changed == 'true'
runs-on: ubuntu-latest

strategy:
Expand All @@ -66,10 +52,8 @@ jobs:

ci:
needs:
- skip_if_release
- should_run
if: needs.skip_if_release.outputs.should_skip != 'true'
|| needs.should_run.outputs.javascript_changed == 'true'
if: needs.should_run.outputs.javascript_changed == 'true'
runs-on: ubuntu-latest

strategy:
Expand All @@ -90,10 +74,8 @@ jobs:

unit:
needs:
- skip_if_release
- should_run
if: needs.skip_if_release.outputs.should_skip != 'true'
|| needs.should_run.outputs.javascript_changed == 'true'
if: needs.should_run.outputs.javascript_changed == 'true'
runs-on: ubuntu-latest

strategy:
Expand All @@ -119,10 +101,8 @@ jobs:

integration:
needs:
- skip_if_release
- should_run
if: needs.skip_if_release.outputs.should_skip != 'true'
|| needs.should_run.outputs.javascript_changed == 'true'
if: needs.should_run.outputs.javascript_changed == 'true'
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -160,10 +140,8 @@ jobs:

versioned-internal:
needs:
- skip_if_release
- should_run
if: needs.skip_if_release.outputs.should_skip != 'true'
|| needs.should_run.outputs.javascript_changed == 'true'
if: needs.should_run.outputs.javascript_changed == 'true'
runs-on: ${{ github.ref == 'refs/heads/main' && vars.NR_RUNNER || 'ubuntu-latest' }}

strategy:
Expand Down Expand Up @@ -211,10 +189,8 @@ jobs:
# There is no coverage for external as that's tracked in their respective repos
versioned-external:
needs:
- skip_if_release
- should_run
if: needs.skip_if_release.outputs.should_skip != 'true'
|| needs.should_run.outputs.javascript_changed == 'true'
if: needs.should_run.outputs.javascript_changed == 'true'
runs-on: ${{ github.ref == 'refs/heads/main' && vars.NR_RUNNER || 'ubuntu-latest' }}

strategy:
Expand Down
48 changes: 45 additions & 3 deletions .github/workflows/compatibility-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,59 @@ jobs:
path: compatibility.md

# Generate the new PR to update the doc in the repo.
- run: |
git config user.name $GITHUB_ACTOR
git config user.email gh-actions-${GITHUB_ACTOR}@github.com
- run: |
rm -f status.log
- uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e
with:
token: ${{ secrets.NODE_AGENT_GH_TOKEN || secrets.GITHUB_TOKEN }}
title: "docs: Updated compatibility report"
commit-message: "docs: Updated compatibility report"
branch: "compatibility-report/auto-update"
delete-branch: true
base: main
labels: "documentation"

docs:
runs-on: ubuntu-latest
if:
github.event_name == 'push' ||
(github.event.workflow_run && github.event.workflow_run.conclusion == 'success') ||
(github.event_name == 'workflow_dispatch' &&
(inputs.repo_target == 'docs' || inputs.repo_target == 'both'))
env:
DOCS_TARGET: src/content/docs/apm/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent.mdx
steps:
- uses: actions/checkout@v4
with:
path: agent
- uses: actions/checkout@v4
with:
repository: newrelic/docs-website
path: docs
- uses: jaxxstorm/action-install-gh-release@71d17cb091aa850acb2a1a4cf87258d183eb941b
with:
repo: newrelic/newrelic-node-versions
platform: linux
arch: amd64
cache: enable
- run: |
nrversions -v -r agent -R ${DOCS_TARGET} 2>docs-status.log
# Upload generated artifacts for potential debugging purposes.
- uses: actions/upload-artifact@v4
with:
name: docs-status.log
path: docs-status.log

# Generate the new PR to update the doc in the repo.
- run: |
rm -f docs-status.log
- uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e
with:
token: ${{ secrets.NODE_AGENT_GH_TOKEN || secrets.GITHUB_TOKEN }}
title: "docs: Updated Node.js agent compatibility report"
commit-message: "docs: Updated Node.js agent compatibility report"
branch: "nodejs-compatibility-report/auto-update"
delete-branch: true
base: develop
labels: "documentation"

0 comments on commit b4b424a

Please sign in to comment.