Skip to content

Commit

Permalink
Add GitHub action for public api change
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-tengler committed May 24, 2021
1 parent a5ff804 commit 53c64fd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
13 changes: 0 additions & 13 deletions .devops/azure-pipelines.test-pr-hotchocolate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,3 @@ stages:
inputs:
artifactName: test-results
pathtoPublish: "output/test-results"
- job: CheckPublicApi
displayName: "Check public API"
dependsOn: [Test]
steps:
- task: UseDotNet@2
displayName: "Install .NET Core"
inputs:
packageType: 'sdk'
useGlobalJson: true
- task: CmdLine@2
displayName: "Check for undocumented public API changes"
inputs:
script: './build.cmd CheckPublicApi'
17 changes: 17 additions & 0 deletions .github/workflows/check-public-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: check-public-api

on:
pull_request:
branches:
- main

jobs:
check-public-api:
name: "Check public API"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# todo: this should get the SDK from global.json, not sure if it's working though
- uses: actions/setup-dotnet@v1
- run: ./build.sh CheckPublicApi
name: "Check for undocumented public API changes"
2 changes: 1 addition & 1 deletion API-Baselines.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ cp scripts/PublicAPI.empty.txt "src/$DIR/PublicAPI.Unshipped.txt"

A PR to `main` will trigger a Pipeline job that runs this analyzer. Contrary to the development environment, where the analyzer only reports warnings, here it throws an error (This behavior is only true if the `RequireDocumentationOfPublicApiChanges` environment variable is set). This is done to enforce highlighting of public API changes.

The job is defined as part of [this Pipeline definition](./.devops/azure-pipelines.test-pr-hotchocolate.yml). It can be easily disabled by adding `condition: false` to the `CheckPublicApi` section or commenting out the section.
The job is defined as part of [this Pipeline definition](./.github/workflows/check-public-api.yml). It can be easily disabled by adding `condition: false` to the `CheckPublicApi` section or commenting out the section.

## Scripts

Expand Down

0 comments on commit 53c64fd

Please sign in to comment.