WIP: Add Meilisearch integration #174
This file contains 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 CI | |
on: | |
pull_request: | |
branches: ["*"] | |
paths: | |
- "src/**" | |
- "examples/**" | |
- "tests/**" | |
- Directory.Build.props | |
- ".github/workflows/**" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ | |
windows-latest, | |
ubuntu-latest, | |
#, macos-latest | |
] | |
fail-fast: false | |
runs-on: "${{ matrix.os }}" | |
env: | |
DOTNET_CONFIGURATION: Release | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.0.x | |
9.0.x | |
- uses: actions/setup-go@v5 | |
name: Set up Go | |
with: | |
go-version: "^1.22.1" | |
cache-dependency-path: | | |
./**/go.sum | |
- uses: actions/setup-java@v4 | |
name: Set up Java | |
with: | |
distribution: "microsoft" | |
java-version: "21" | |
- uses: actions/setup-node@v4 | |
name: Set up Node.js | |
with: | |
node-version: "latest" | |
- uses: pnpm/action-setup@v4 | |
name: Setup pnpm | |
with: | |
version: 9 | |
run_install: false | |
- uses: actions/cache@v4 | |
name: Cache NuGet packages | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('Directory.Packages.props') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- uses: actions/cache@v4 | |
name: Cache Java Docker images | |
with: | |
path: /var/lib/docker/image | |
key: ${{ runner.os }}-docker-${{ hashFiles('examples/java/Aspire.CommunityToolkit.Hosting.Java.Spring.Maven/Dockerfile') }} | |
restore-keys: | | |
${{ runner.os }}-docker- | |
- name: Install Aspire workload | |
run: dotnet workload update && dotnet workload install aspire | |
- name: Setup .NET dev certs | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
dotnet tool update -g linux-dev-certs | |
dotnet linux-dev-certs install | |
- name: Setup Node projects | |
run: | | |
npm install -g @azure/static-web-apps-cli | |
cd examples/swa/Aspire.CommunityToolkit.StaticWebApps.WebApp | |
npm ci | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore --configuration ${{ env.DOTNET_CONFIGURATION }} | |
- name: Test | |
run: dotnet test --no-build --configuration ${{ env.DOTNET_CONFIGURATION }} --collect "XPlat Code Coverage" --results-directory test-results --logger trx /p:TrxLogFileNameSuffix=${{ matrix.os }} | |
- name: Publish NuGet package | |
run: dotnet pack --no-build -c ${{ env.DOTNET_CONFIGURATION }} -o ./nuget -p:VersionSuffix='alpha.${{ github.run_number }}' | |
## Only publish NuGet packages on Ubuntu, since we don't need to publish them on every OS | |
- name: Publish NuGet packages as artifacts | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget-packages | |
path: ./nuget | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-results-${{ matrix.os }} | |
path: | | |
${{ github.workspace }}/test-results/** | |
publish-github-packages: | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: github-packages | |
steps: | |
- name: Download package | |
uses: actions/download-artifact@v4 | |
with: | |
name: nuget-packages | |
- name: Publish to GitHub packages | |
run: dotnet nuget push ./*.nupkg --source "https://nuget.pkg.github.com/communitytoolkit/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} | |