diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8427da..27ff1fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,41 +11,46 @@ jobs: configuration: [Debug, Release] steps: - - name: Checkout code - uses: actions/checkout@v4.2.0 - with: - fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - - - uses: dotnet/nbgv@master - id: nbgv - - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - - - name: Build with MSBuild - run: | - msbuild jN.vcxproj /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:VersionMajor=${{steps.nbgv.outputs.VersionMajor}} /p:VersionMinor=${{steps.nbgv.outputs.VersionMinor}} /p:BuildNumber=${{steps.nbgv.outputs.BuildNumber}} /p:VersionRevision=${{steps.nbgv.outputs.VersionRevision}} - - - name: Create zip file - run: | - if ("${{ matrix.platform }}" -eq "x64"){ - Copy-Item ${{ matrix.platform}}/${{ matrix.configuration }}/*.dll ./deploy/ - } else { - Copy-Item ${{ matrix.configuration }}/*.dll ./deploy/ - } - - cd ./deploy - 7z a ../jN_${{ steps.nbgv.outputs.SemVer2 }}_${{ matrix.platform }}.zip * - - - name: Upload artifacts - uses: actions/upload-artifact@v4.4.0 - with: - name: Build artifacts ${{ matrix.platform }} ${{ matrix.configuration }} - path: | - jN_*.zip - ${{ matrix.configuration }}/*.dll - ${{ matrix.configuration }}/*.pdb - ${{ matrix.platform }}/${{ matrix.configuration }}/*.dll - ${{ matrix.platform }}/${{ matrix.configuration }}/*.pdb - - retention-days: 3 \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v4.2.0 + with: + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. + + - uses: dotnet/nbgv@master + id: nbgv + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Build with MSBuild + run: | + msbuild jN.vcxproj /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:VersionMajor=${{steps.nbgv.outputs.VersionMajor}} /p:VersionMinor=${{steps.nbgv.outputs.VersionMinor}} /p:BuildNumber=${{steps.nbgv.outputs.BuildNumber}} /p:VersionRevision=${{steps.nbgv.outputs.VersionRevision}} + + - name: Test + run: | + msbuild jn.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} + "${{ matrix.platform }}/${{ matrix.configuration }}/tests.exe" + + - name: Create zip file + run: | + if ("${{ matrix.platform }}" -eq "x64"){ + Copy-Item ${{ matrix.platform}}/${{ matrix.configuration }}/*.dll ./deploy/ + } else { + Copy-Item ${{ matrix.configuration }}/*.dll ./deploy/ + } + + cd ./deploy + 7z a ../jN_${{ steps.nbgv.outputs.SemVer2 }}_${{ matrix.platform }}.zip * + + - name: Upload artifacts + uses: actions/upload-artifact@v4.4.0 + with: + name: Build artifacts ${{ matrix.platform }} ${{ matrix.configuration }} + path: | + jN_*.zip + ${{ matrix.configuration }}/*.dll + ${{ matrix.configuration }}/*.pdb + ${{ matrix.platform }}/${{ matrix.configuration }}/*.dll + ${{ matrix.platform }}/${{ matrix.configuration }}/*.pdb + + retention-days: 3