-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (79 loc) · 2.89 KB
/
ubuntu.yml
File metadata and controls
86 lines (79 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# 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: ubuntu
on:
push:
paths-ignore:
- './.github'
branches: [ "master" ]
pull_request:
paths-ignore:
- './.github'
branches: [ "master" ]
jobs:
build:
strategy:
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Debug --no-restore
- name: Upload artifact
uses: actions/upload-artifact@v4.6.2
with:
name: cstojs-${{ matrix.os }}-artifact
path: /home/runner/work/CSharpToJavaScript/CSharpToJavaScript/CSharpToJavaScript/bin/Debug/net8.0/
if-no-files-found: error
compression-level: 0
test:
needs: build
strategy:
matrix:
os: [ubuntu-24.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/github-repo-action@v3.1
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: 10.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: Replace reference
run: sed -i 's+</Project>+<ItemGroup><Reference Include="CSharpToJavaScript"><HintPath>/home/runner/artifact/CSharpToJavaScript.dll</HintPath></Reference></ItemGroup></Project>+g' CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj
- name: Cat CSTOJS_Tests.csproj
run: cat CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj
- name: Add Microsoft.CodeAnalysis.CSharp.Workspaces reference
run: dotnet add CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj package Microsoft.CodeAnalysis.CSharp.Workspaces
- name: Run tests
run: dotnet test CSTOJS_Tests/CSTOJS_Tests/CSTOJS_Tests.csproj --logger "html;logfilename=test-result-${{ matrix.os }}.html;verbosity=detailed" --results-directory ~/artifact/
- name: Upload test result
uses: actions/upload-artifact@v4.6.2
with:
name: test-result-${{ matrix.os }}
path: ~/artifact/test-result-${{ matrix.os }}.html
if-no-files-found: error
if: ${{ always() }}