Skip to content

Update ubuntu.yml

Update ubuntu.yml #3

Workflow file for this run

# 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:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
runs-on: ${{ matrix.os }}
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-${{ matrix.os }}-artifact
path: ./CSharpToJavaScript/CSharpToJavaScript/CSharpToJavaScript/bin/Debug/net8.0/
if-no-files-found: error
compression-level: 0
test:
needs: build
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/download-artifact@v4
with:
name: cstojs-${{ matrix.os }}-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: Replace reference
run: sed -i 's/<ProjectReference Include="..\..\CSharpToJavaScript\CSharpToJavaScript\CSharpToJavaScript.csproj" />/<Reference Include="MyAssembly"><HintPath>~\artifact\CSharpToJavaScript.dll</HintPath></Reference>/g' CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj
- name: Run tests
run: dotnet test CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj --logger "html;logfilename=test-result-${{ matrix.os }}.html;verbosity=detailed"
- name: Upload test result
uses: actions/[email protected]
with:
name: test-result-${{ matrix.os }}
path: ./test-result-${{ matrix.os }}.html
if-no-files-found: error
if: ${{ always() }}