-
-
Notifications
You must be signed in to change notification settings - Fork 93
147 lines (130 loc) · 4.21 KB
/
main.yml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Build and Test
on:
push:
branches-ignore:
- 'circleci'
paths-ignore:
- 'samples/*'
- 'stress/*'
- 'performance/*'
- '.github/FUNDING.YML'
- '**/*.md'
- '**/*.d.ts'
- '**/*.bat'
- '.travis.yml'
- 'Dockerfile'
- '.gitconfig'
- '.gitignore'
- 'appveyor*.*'
- 'LICENSE*'
- '.idea/**'
- '.vscode/**'
- '*.bat'
- '*.nuspec'
- 'tools/nuget/*'
- '.npmignore'
- 'test/config.json'
- 'test/double'
- '.circleci'
- '.circleci/*'
- 'README.md'
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # required to setup CSC
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build-test:
runs-on: ${{ matrix.os }}
name: build-test-${{ matrix.os }}-electron-${{ matrix.electron }}
strategy:
matrix:
# os: [macos-14, macos-latest, ubuntu-latest, windows-2019]
os: [ ubuntu-latest]
# electron: [30.5.0, 31.6.0]
electron: [30.5.0, 31.6.0]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ matrix.os }}-${{ matrix.electron }}-${{ hashFiles('package-lock.json') }}
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x' # SDK Version to use; x will use the latest version of the 8.0 channel
- name: Versions
run: node -v && npm -v && dotnet --version && node -p process.platform && node -p process.arch
- name: setup electorn version
run: |
sed -i -e 's/"electron": "=31.6.0"/"electron": "=${{ matrix.electron }}"/g' package.json
- name: npm install
run: npm i --no-audit
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
- if: runner.os == 'macOS' || runner.os == 'Linux'
name: Check electron-edge-js build
id: check_build
uses: andstor/file-existence-action@v3
with:
files: "build/Release/edge_coreclr.node"
- if: runner.os == 'Windows'
name: Run .NET 4.5 tests
run: node tools/test.js CI
- if: runner.os == 'macOS'
name: "Run .net core tests"
run: |
if: steps.check_build.outputs.files_exists == 'false'
echo "Failed to build electron-edge-js for Electron ${{ matrix.electron }}"
exit 1
if: steps.check_build.outputs.files_exists == 'true'
node tools/test.js CI
env:
EDGE_USE_CORECLR: 1
- if: runner.os == 'Linux'
name: "Run .net core tests"
run: |
if: steps.check_build.outputs.files_exists == 'false'
echo "Failed to build electron-edge-js for Electron ${{ matrix.electron }}"
exit 1
if: steps.check_build.outputs.files_exists == 'true'
export DISPLAY=:99
echo "DISPLAY=:99" >> $GITHUB_ENV
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 3
node tools/test.js CI
env:
EDGE_USE_CORECLR: 1
- name: Upload artifacts
uses: actions/[email protected]
if: success()
with:
name: ${{ matrix.os }}-${{ matrix.electron }}
path: |
test/mochawesome-report/test-results-coreclr.json
test/mochawesome-report/test-results-coreclr.html
# - name: Upload artifacts
# uses: actions/[email protected]
# if: success()
# with:
# name: ${{ matrix.os }}-${{ matrix.node }}
# path: |
# test-results.xml
# mochawesome.json
# - name: Test Report
# uses: phoenix-actions/test-reporting@v15
# if: success()
# with:
# name: test-results-${{ matrix.os }}-node-${{ matrix.node }}
# fail-on-error: true
# path: mochawesome.json # Path to test results
# reporter: mochawesome-json