Skip to content

Add workflow for compiling client against docs #16

Add workflow for compiling client against docs

Add workflow for compiling client against docs #16

name: Compile against documentation examples
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
pull-requests: write
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test-compilation:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Run compilation tests
id: compile_step
continue-on-error: true
uses: datastax/astra-client-docs-tests/.github/actions/test-compilation@master
with:
clients: 'csharp'
args: -A csharp='<ProjectReference Include=\"${{ github.workspace }}/src/DataStax.AstraDB.DataApi/DataStax.AstraDB.DataApi.csproj\"/>'
docs-repo-token: ${{ secrets.DOC_GITHUB_PAT_CROSS_ORG }}
docs-repo: '@ske-csharp-client'
- name: Label PR on failure
uses: actions-ecosystem/action-add-labels@v1
if: always() && steps.compile_step.outcome == 'failure' && github.event_name == 'pull_request'
with:
labels: 'Breaks Docs Compilation Tests'
- name: Remove label on success
uses: actions-ecosystem/action-remove-labels@v1
if: always() && steps.compile_step.outcome != 'failure' && github.event_name == 'pull_request'
with:
labels: 'Breaks Docs Compilation Tests'