Skip to content

Commit 1005c6f

Browse files
authored
Create ubuntu.yml
1 parent 9411cf1 commit 1005c6f

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/ubuntu.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: .NET
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
build:
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
17+
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: 8.0.x
26+
- name: Restore dependencies
27+
run: dotnet restore
28+
- name: Build
29+
run: dotnet build -c Debug --no-restore
30+
- name: Upload artifact
31+
uses: actions/[email protected]
32+
with:
33+
name: cstojs-${{ matrix.os }}-artifact
34+
path: ./CSharpToJavaScript/CSharpToJavaScript/bin/Debug/net8.0/
35+
if-no-files-found: error
36+
compression-level: 0
37+
test:
38+
needs: build
39+
strategy:
40+
matrix:
41+
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
42+
43+
runs-on: ${{ matrix.os }}
44+
45+
steps:
46+
- uses: actions/download-artifact@v4
47+
with:
48+
name: cstojs-${{ matrix.os }}-artifact
49+
path: ~/artifact/
50+
- name: Display structure of downloaded files
51+
run: ls -R ~/artifact/
52+
- name: Clone CSTOJS_Tests
53+
uses: whyakari/[email protected]
54+
with:
55+
owner: TiLied
56+
repository: CSTOJS_Tests
57+
branch: 'master'
58+
- name: Access cloned repository content
59+
run: ls -R CSTOJS_Tests
60+
- name: Setup .NET
61+
uses: actions/setup-dotnet@v4
62+
with:
63+
dotnet-version: 8.0.x
64+
- name: Replace reference
65+
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
66+
- name: Run tests
67+
run: dotnet test CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj --logger "html;logfilename=test-result-${{ matrix.os }}.html;verbosity=detailed"
68+
- name: Upload test result
69+
uses: actions/[email protected]
70+
with:
71+
name: test-result-${{ matrix.os }}
72+
path: ./test-result-${{ matrix.os }}.html
73+
if-no-files-found: error
74+
if: ${{ always() }}

0 commit comments

Comments
 (0)