#325 udpate proejct settings #1682
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 MiniSpace Microservice build & integration | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
include: | |
- project: 'MiniSpace.APIGateway/src/MiniSpace.APIGateway' | |
- project: 'MiniSpace.Services.Identity/src/MiniSpace.Services.Identity.Api' | |
test_dir: 'MiniSpace.Services.Identity/tests' | |
- project: 'MiniSpace.Services.Posts/src/MiniSpace.Services.Posts.Api' | |
test_dir: 'MiniSpace.Services.Posts/tests' | |
- project: 'MiniSpace.Services.Comments/src/MiniSpace.Services.Comments.Api' | |
test_dir: 'MiniSpace.Services.Comments/tests' | |
# - project: 'MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Api' | |
# test_dir: 'MiniSpace.Services.Organizations/tests' | |
- project: 'MiniSpace.Services.Posts/src/MiniSpace.Services.Posts.Api' | |
test_dir: 'MiniSpace.Services.Posts/tests' | |
- project: 'MiniSpace.Services.Reactions/src/MiniSpace.Services.Reactions.Api' | |
test_dir: 'MiniSpace.Services.Reactions/tests' | |
- project: 'MiniSpace.Services.Events/src/MiniSpace.Services.Events.Api' | |
test_dir: 'MiniSpace.Services.Events/tests' | |
- project: 'MiniSpace.Services.Students/src/MiniSpace.Services.Students.Api' | |
test_dir: 'MiniSpace.Services.Students/tests' | |
- project: 'MiniSpace.Web/src/MiniSpace.Web' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET 8.0.x | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Restore dependencies for ${{ matrix.project }} | |
run: dotnet restore ${{ matrix.project }} | |
- name: Build ${{ matrix.project }} | |
run: dotnet build ${{ matrix.project }} --no-restore | |
- name: Restore dependencies for test projects in ${{ matrix.test_dir }} | |
if: matrix.test_dir != '' | |
run: | | |
echo "Restoring test projects in ${{ matrix.test_dir }}" | |
find ${{ matrix.test_dir }} -name '*.csproj' -exec dotnet restore {} \; | |
- name: Run tests and collect coverage in ${{ matrix.test_dir }} | |
if: matrix.test_dir != '' | |
run: | | |
echo "Running tests and collecting coverage in ${{ matrix.test_dir }}" | |
find ${{ matrix.test_dir }} -name '*.csproj' -exec sh -c 'dotnet test "{}" --no-restore --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura || exit 1' \; | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: '**/coverage.cobertura.xml' | |
slug: SaintAngeLs/distributed_minispace | |
commit: ${{ github.event.pull_request.base.sha }} | |
# fail_ci_if_error: true |