Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Added workflow for generating compatibility doc #2183

Merged
merged 5 commits into from
May 9, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/compatibility-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Generate Compatibility Report

on:
workflow_dispatch:
inputs:
repo_target:
description: Generate the report for the local repo, the docs repo, or both.
required: true
type: choice
default: both
options:
- local
- docs
- both

push:
branches:
- main
paths:
- 'test/versioned/**/package.json'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is just saying re-run automatically when we add new versioned tests for a library. This seems very rare and more importantly would this run on a scheduled basis because the newer versions of a given library we instrument happens frequently. also, I'd see this getting run on release right?

You may want to add this like post release or but this in there right?

    workflows: ["Create Release"]
    types:
      - completed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is saying: "every time a push to the main branch occurs (i.e. a pull request was merged into main), and there have been changes to any package.json file that resides under test/versioned/, run the workflow".

We can add a scheduled run of this if it is desired. It would be a separate "on" block like the workflow_dispatch block.


jobs:
local:
runs-on: ubuntu-latest
if:
github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' &&
(inputs.repo_target == 'local' || inputs.repo_target == 'both'))
steps:
- uses: actions/checkout@v4
- uses: jaxxstorm/action-install-gh-release@71d17cb091aa850acb2a1a4cf87258d183eb941b
with:
repo: newrelic/newrelic-node-versions
platform: linux
arch: amd64
cache: enable
- run: |
nrversions -v -r . 2>status.log >./compatibility.md
jsumners-nr marked this conversation as resolved.
Show resolved Hide resolved

# Upload generated artifacts for potential debugging purposes.
- uses: actions/upload-artifact@v4
with:
name: status.log
path: status.log
- uses: actions/upload-artifact@v4
with:
name: compatibility.md
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
bizob2828 marked this conversation as resolved.
Show resolved Hide resolved
with:
title: "docs: Updated compatibility report"
commit-message: "docs: Updated compatibility report"
branch: "compatibility-report/auto-update"
delete-branch: true
base: main
labels: "documentation"