@@ -2,24 +2,34 @@ name: CI
2
2
3
3
on : [push, pull_request]
4
4
5
+ # Cancel any previous workflows if the pull request was updated
6
+ concurrency :
7
+ group : ${{ github.workflow }}-${{ github.ref || github.run_id }}
8
+ cancel-in-progress : true
9
+
5
10
jobs :
6
11
build :
7
12
if : github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
8
13
strategy :
9
14
fail-fast : false
10
15
matrix :
11
- config :
12
- - { os: ubuntu-22.04, platform: x64, cxx: g++-11, cc: gcc-11 }
13
- - { os: macos-12, platform: x64, cxx: clang++, cc: clang }
14
- - { os: windows-2022, platform: x64, vs: "Program Files/Microsoft Visual Studio/2022" }
16
+ os : [ubuntu-22.04, macos-12, windows-2022]
17
+ platform : [x64]
18
+ build-cfg : [DebugOpt, Release]
19
+ # build-cfg: [Debug, DebugOpt, Release] # our local copy of clang isn't build for debug on linux/macos currently
20
+ include :
21
+ - os : windows-2022
22
+ platform : x64
23
+ build-cfg : Debug
15
24
16
- runs-on : ${{ matrix.config. os }}
25
+ runs-on : ${{ matrix.os }}
17
26
18
27
env :
19
- CC : ${{ matrix.config.cc }}
20
- CXX : ${{ matrix.config.cxx }}
21
- VS_VERSION : ${{ matrix.config.vs }}
22
- PLATFORM : ${{ matrix.config.platform }}
28
+ CC : ${{ startsWith(matrix.os, 'ubuntu') && 'gcc-11' || 'clang' }}
29
+ CXX : ${{ startsWith(matrix.os, 'ubuntu') && 'g++-11' || 'clang++' }}
30
+ VS_VERSION : " Program Files/Microsoft Visual Studio/2022"
31
+ PLATFORM : ${{ matrix.platform }}
32
+ BUILD_CONFIGURATION : ${{ matrix.build-cfg }}
23
33
DOTNET_NOLOGO : true
24
34
DOTNET_CLI_TELEMETRY_OPTOUT : true
25
35
EMSCRIPTEN_VERSION : 3.1.65
@@ -41,59 +51,63 @@ jobs:
41
51
cmake-version : ' 3.30.x'
42
52
43
53
- name : Install nbgv
44
- if : startsWith(matrix.config. os, 'macos')
54
+ if : startsWith(matrix.os, 'macos')
45
55
run : |
46
56
dotnet tool install -g nbgv
47
57
48
58
- name : Set version
49
59
run : nbgv cloud --all-vars
50
60
51
61
- name : Environment
52
- if : matrix.config.vs
62
+ if : startsWith( matrix.os, 'windows')
53
63
shell : bash
54
64
run : echo "/c/$VS_VERSION/Enterprise/MSBuild/Current/Bin" >> $GITHUB_PATH
55
65
56
66
- name : Setup
57
67
shell : bash
58
68
run : |
59
- build/build.sh generate -platform $PLATFORM
60
- build/build.sh download_llvm -platform $PLATFORM
69
+ build/build.sh generate -platform $PLATFORM -configuration $BUILD_CONFIGURATION
70
+ build/build.sh download_llvm -platform $PLATFORM -configuration $BUILD_CONFIGURATION
61
71
62
72
- name : Restore
63
73
shell : bash
64
- run : build/build.sh restore -platform $PLATFORM
74
+ run : build/build.sh restore -platform $PLATFORM -configuration $BUILD_CONFIGURATION
65
75
66
76
- name : Build
67
77
shell : bash
68
- run : build/build.sh -platform $PLATFORM -build_only
78
+ run : build/build.sh -platform $PLATFORM -build_only -configuration $BUILD_CONFIGURATION
69
79
70
80
- name : Test (.NET)
81
+ # Disable test for debug configs, since they take over 6 hours to complete
82
+ if : matrix.build-cfg != 'Debug'
71
83
shell : bash
72
- run : build/test.sh -platform $PLATFORM
84
+ run : build/test.sh -platform $PLATFORM -configuration $BUILD_CONFIGURATION
73
85
74
86
- name : Build (QuickJS runtime)
87
+ if : runner.os != 'Windows'
75
88
shell : bash
76
89
run : tests/quickjs/bootstrap.sh
77
- if : runner.os != 'Windows'
78
90
79
91
- name : Test (QuickJS)
80
- shell : bash
81
- run : tests/quickjs/test.sh
82
92
if : runner.os != 'Windows'
93
+ shell : bash
94
+ run : tests/quickjs/test.sh -dotnet_configuration $BUILD_CONFIGURATION
83
95
84
96
- name : Test (Emscripten)
85
- shell : bash
86
- run : tests/emscripten/test.sh
87
97
if : runner.os != 'Windows'
98
+ shell : bash
99
+ run : tests/emscripten/test.sh -dotnet_configuration $BUILD_CONFIGURATION
88
100
89
101
- name : Pack
90
102
shell : bash
91
- run : build/build.sh prepack -platform $PLATFORM
103
+ run : build/build.sh prepack -platform $PLATFORM -configuration $BUILD_CONFIGURATION
92
104
93
105
- name : Upload Artifacts
106
+ # We only need a release version of this in the create_package job
107
+ if : matrix.build-cfg == 'Release'
94
108
uses : actions/upload-artifact@v4
95
109
with :
96
- name : intermediate
110
+ name : intermediate-${{ matrix.build-cfg }}-${{ matrix.platform }}
97
111
retention-days : 7
98
112
overwrite : true
99
113
path : |
@@ -110,6 +124,7 @@ jobs:
110
124
env :
111
125
DOTNET_NOLOGO : true
112
126
DOTNET_CLI_TELEMETRY_OPTOUT : true
127
+ BUILD_CONFIGURATION : Release
113
128
114
129
steps :
115
130
- uses : actions/checkout@v4
@@ -121,15 +136,15 @@ jobs:
121
136
122
137
- uses : actions/download-artifact@v4
123
138
with :
124
- name : intermediate
139
+ name : intermediate-Release-x64
125
140
126
141
- name : Setup
127
142
shell : bash
128
- run : build/build.sh generate_config
143
+ run : build/build.sh generate_config -configuration $BUILD_CONFIGURATION
129
144
130
145
- name : Create package
131
146
shell : bash
132
- run : build/build.sh pack
147
+ run : build/build.sh pack -configuration $BUILD_CONFIGURATION
133
148
134
149
- name : Upload package
135
150
uses : actions/upload-artifact@v4
0 commit comments