.NET package CI #36
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: .NET package CI | |
| on: [workflow_dispatch] | |
| # Least privilege: no step in this workflow writes to the repo, | |
| # releases or packages via GITHUB_TOKEN (publishing uses NUGET_API_KEY, | |
| # signing uses GCP_SA_KEY). Fail closed regardless of the org default. | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| working-directory: BrowserStackLocal | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@0717577d45739eb3c851188b29f50ed6c0b2194e # v2 | |
| - name: Add msbuild to PATH | |
| uses: microsoft/setup-msbuild@c26a08ba26249b81327e26f6ef381897b6a8754d # v1.0.2 | |
| - name: Build BrowserStackLocal | |
| run: | | |
| msbuild BrowserStackLocal -t:restore -p:Configuration=Release | |
| msbuild BrowserStackLocal -t:build -p:Configuration=Release | |
| - name: Build Test project | |
| run: | | |
| msbuild BrowserStackLocalIntegrationTests -t:restore -p:Configuration=Release | |
| msbuild BrowserStackLocalIntegrationTests -t:build -p:Configuration=Release | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@55ec9447dda3d1cf6bd587150f3262f30ee10815 # v3 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Run Integration Tests | |
| env: | |
| BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} | |
| BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} | |
| run: dotnet test BrowserStackLocalIntegrationTests --no-build -p:Configuration=Release | |
| - name: Pack NuGet Package | |
| run: msbuild BrowserStackLocal -t:pack -p:Configuration=Release | |
| - name: Save artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: BrowserStackLocal.nupkg | |
| path: .\BrowserStackLocal\BrowserStackLocal\bin\Release\*.nupkg |