Ajuste | Github Workflow #3
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 Core CI | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| configuration: [Debug, Release] | |
| runs-on: windows-latest | |
| env: | |
| Solution_Name: ExplorandoMarte.sln # Nome da solução | |
| Test_Project_Path: ExplorandoMarte.Tests/ExplorandoMarte.Tests.csproj # Caminho para o projeto de testes | |
| Publish_Directory: ExplorandoMarte/publish # Diretório de publicação | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v2 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore ${{ env.Solution_Name }} | |
| - name: Build | |
| run: dotnet build ${{ env.Solution_Name }} --configuration ${{ matrix.configuration }} --no-restore | |
| - name: Run tests | |
| run: dotnet test ${{ env.Test_Project_Path }} --configuration ${{ matrix.configuration }} --no-restore --verbosity normal | |
| - name: Publish | |
| run: dotnet publish ${{ env.Solution_Name }} --configuration ${{ matrix.configuration }} --output ${{ env.Publish_Directory }} | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v2 | |
| with: | |
| name: Published EXE | |
| path: ${{ env.Publish_Directory }} | |