fix: make OsduClient service-client initialisation thread-safe #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Tests | |
| on: | |
| pull_request: | |
| branches: [main] | |
| # Called by the release workflow so nothing is published without a green test run. | |
| workflow_call: | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Build and test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.13" | |
| - name: Install Python dependencies | |
| run: pip install -r requirements.txt | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 | |
| with: | |
| dotnet-version: "10.x" | |
| - name: Install Kiota | |
| run: dotnet tool install --global Microsoft.OpenApi.Kiota | |
| # Generated clients are not committed, so they must be produced before anything compiles. | |
| - name: Generate C# clients | |
| run: python generate_all.py | |
| # Builds the whole solution, so the integration test project is compile-checked too. | |
| - name: Build | |
| run: dotnet build OsduCsharpClient.slnx --configuration Release | |
| # Unit tests only — the integration tests need credentials for a live OSDU instance. | |
| - name: Run unit tests | |
| run: > | |
| dotnet test tests/OsduCsharpClient.Tests/OsduCsharpClient.Tests.csproj | |
| --configuration Release | |
| --no-build | |
| --logger "trx;LogFileName=test-results.trx" | |
| - name: Upload test results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: test-results | |
| path: "**/TestResults/*.trx" | |
| retention-days: 5 |