Update dotnet.yml #16
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
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: .NET | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| name: Build and upload artifact. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build -c Debug --no-restore | |
| - name: Upload artifact | |
| uses: actions/[email protected] | |
| with: | |
| name: cstojs-artifact | |
| path: /home/runner/work/CSharpToJavaScript/CSharpToJavaScript/CSharpToJavaScript/bin/Debug/net8.0/ | |
| if-no-files-found: error | |
| compression-level: 0 | |
| test: | |
| needs: build | |
| name: Test artifact | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: cstojs-artifact | |
| path: ~/artifact/ | |
| - name: Display structure of downloaded files | |
| run: ls -R ~/artifact/ | |
| - name: Clone CSTOJS_Tests | |
| uses: whyakari/[email protected] | |
| with: | |
| owner: TiLied | |
| repository: CSTOJS_Tests | |
| branch: 'master' | |
| - name: Access cloned repository content | |
| run: ls -R CSTOJS_Tests | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: List refs | |
| run: dotnet list CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj reference | |
| - name: Delete reference | |
| run: dotnet remove CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj reference "..\..\CSharpToJavaScript\CSharpToJavaScript\CSharpToJavaScript.csproj" | |
| - name: Add reference | |
| run: dotnet add CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj reference /home/runner/work/CSharpToJavaScript/CSharpToJavaScript/CSharpToJavaScript/CSharpToJavaScript.csproj | |
| - name: Run tests | |
| run: dotnet test CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj |