Fix #834: emit NullableAttribute / NullableContextAttribute for T? reference parameters #1188
Workflow file for this run
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: build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET SDK (main) | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Restore | |
| run: dotnet restore GSharp.sln | |
| - name: Restore .NET local tools | |
| # Brings in `dotnet-ilverify`, which Compiler.Tests invokes via | |
| # `IlVerifier.Verify` to mechanically validate every assembly emitted | |
| # by gsc against ECMA-335. The manifest is at .config/dotnet-tools.json. | |
| run: dotnet tool restore | |
| - name: Show Nerdbank.GitVersioning version | |
| # Surface the version nbgv will stamp on assemblies / NuGet packages so | |
| # that, when a build from `main` is green, the printed NuGetPackageVersion | |
| # can be used directly as the `vX.Y.Z` release tag. | |
| run: | | |
| dotnet tool install --global nbgv || dotnet tool update --global nbgv | |
| export PATH="$PATH:$HOME/.dotnet/tools" | |
| nbgv get-version | |
| { | |
| echo "### Nerdbank.GitVersioning" | |
| echo '' | |
| echo '```' | |
| nbgv get-version | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Build | |
| # Build the solution explicitly with the static project graph so each | |
| # project (notably Compiler, which is referenced by Compiler.Tests) is | |
| # built exactly once. A bare `dotnet build` schedules projects in | |
| # parallel against a shared OutputPath and can race on | |
| # GenerateRuntimeConfigurationFiles writing `gsc.runtimeconfig.json`. | |
| run: dotnet build GSharp.sln --configuration Release --no-restore -graph | |
| - name: Test | |
| run: dotnet test GSharp.sln --configuration Release --no-build --logger "trx" --results-directory TestResults | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: test-results | |
| path: TestResults/**/*.trx | |
| - name: Upload NuGet packages | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: nuget-packages | |
| path: out/bin/Release/nupkgs/*.nupkg | |
| e2e: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET SDK (main) | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Setup .NET 8 (for multitarget tests) | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore | |
| run: dotnet restore GSharp.sln | |
| - name: Install netcoredbg | |
| run: | | |
| URL=$(curl -sSL https://api.github.com/repos/Samsung/netcoredbg/releases/latest \ | |
| | grep -oP '"browser_download_url":\s*"\K[^"]*linux-amd64\.tar\.gz') | |
| curl -sSL "$URL" -o /tmp/netcoredbg.tar.gz | |
| mkdir -p "$HOME/.tools/netcoredbg" | |
| tar -xzf /tmp/netcoredbg.tar.gz -C "$HOME/.tools/netcoredbg" --strip-components=1 | |
| echo "$HOME/.tools/netcoredbg" >> "$GITHUB_PATH" | |
| - name: Run end-to-end tests | |
| run: ./build/run-e2e-tests.sh | |
| vscode-extension: | |
| name: vscode-extension (${{ matrix.os }}) | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| working-directory: src/vscode-gsharp | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| cache-dependency-path: src/vscode-gsharp/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Compile | |
| run: npm run compile | |
| - name: Lint | |
| run: npm run lint | |
| - name: Unit Tests | |
| run: npm run test:unit | |
| vsix: | |
| runs-on: ubuntu-latest | |
| needs: vscode-extension | |
| defaults: | |
| run: | |
| working-directory: src/vscode-gsharp | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| global-json-file: global.json | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| cache-dependency-path: src/vscode-gsharp/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Compile | |
| run: npm run compile | |
| - name: Stamp version (Nerdbank.GitVersioning) | |
| # The VS Code Marketplace requires a strict major.minor.patch version, so | |
| # use nbgv's SimpleVersion (0.1.<git-height>) which is always clean across | |
| # branches and tags. The change is workspace-only and never committed. | |
| run: | | |
| dotnet tool install --global nbgv || dotnet tool update --global nbgv | |
| export PATH="$PATH:$HOME/.dotnet/tools" | |
| VERSION=$(nbgv get-version -v SimpleVersion) | |
| echo "Extension version: $VERSION" | |
| npm version "$VERSION" --no-git-tag-version --allow-same-version | |
| - name: Package VSIX | |
| run: npx vsce package --no-dependencies -o vscode-gsharp.vsix | |
| - name: Upload VSIX | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: vscode-gsharp-vsix | |
| path: src/vscode-gsharp/vscode-gsharp.vsix | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: [e2e, vsix] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download NuGet packages | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: nuget-packages | |
| path: ./nupkgs | |
| - name: Download VSIX | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: vscode-gsharp-vsix | |
| path: ./vsix | |
| - name: Create GitHub Release with all assets | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" \ | |
| || gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --generate-notes --title "$GITHUB_REF_NAME" | |
| gh release upload "$GITHUB_REF_NAME" ./nupkgs/*.nupkg ./vsix/*.vsix --repo "$GITHUB_REPOSITORY" --clobber | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Push to NuGet | |
| run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: '24' | |
| - name: Publish to VS Code Marketplace | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| run: npx --yes @vscode/vsce publish --packagePath ./vsix/vscode-gsharp.vsix |