@@ -2,24 +2,34 @@ name: CI
22
33on : [push, pull_request]
44
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+
510jobs :
611 build :
712 if : github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
813 strategy :
914 fail-fast : false
1015 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
1524
16- runs-on : ${{ matrix.config. os }}
25+ runs-on : ${{ matrix.os }}
1726
1827 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 }}
2333 DOTNET_NOLOGO : true
2434 DOTNET_CLI_TELEMETRY_OPTOUT : true
2535 EMSCRIPTEN_VERSION : 3.1.65
@@ -41,59 +51,63 @@ jobs:
4151 cmake-version : ' 3.30.x'
4252
4353 - name : Install nbgv
44- if : startsWith(matrix.config. os, 'macos')
54+ if : startsWith(matrix.os, 'macos')
4555 run : |
4656 dotnet tool install -g nbgv
4757
4858 - name : Set version
4959 run : nbgv cloud --all-vars
5060
5161 - name : Environment
52- if : matrix.config.vs
62+ if : startsWith( matrix.os, 'windows')
5363 shell : bash
5464 run : echo "/c/$VS_VERSION/Enterprise/MSBuild/Current/Bin" >> $GITHUB_PATH
5565
5666 - name : Setup
5767 shell : bash
5868 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
6171
6272 - name : Restore
6373 shell : bash
64- run : build/build.sh restore -platform $PLATFORM
74+ run : build/build.sh restore -platform $PLATFORM -configuration $BUILD_CONFIGURATION
6575
6676 - name : Build
6777 shell : bash
68- run : build/build.sh -platform $PLATFORM -build_only
78+ run : build/build.sh -platform $PLATFORM -build_only -configuration $BUILD_CONFIGURATION
6979
7080 - name : Test (.NET)
81+ # Disable test for debug configs, since they take over 6 hours to complete
82+ if : matrix.build-cfg != 'Debug'
7183 shell : bash
72- run : build/test.sh -platform $PLATFORM
84+ run : build/test.sh -platform $PLATFORM -configuration $BUILD_CONFIGURATION
7385
7486 - name : Build (QuickJS runtime)
87+ if : runner.os != 'Windows'
7588 shell : bash
7689 run : tests/quickjs/bootstrap.sh
77- if : runner.os != 'Windows'
7890
7991 - name : Test (QuickJS)
80- shell : bash
81- run : tests/quickjs/test.sh
8292 if : runner.os != 'Windows'
93+ shell : bash
94+ run : tests/quickjs/test.sh -dotnet_configuration $BUILD_CONFIGURATION
8395
8496 - name : Test (Emscripten)
85- shell : bash
86- run : tests/emscripten/test.sh
8797 if : runner.os != 'Windows'
98+ shell : bash
99+ run : tests/emscripten/test.sh -dotnet_configuration $BUILD_CONFIGURATION
88100
89101 - name : Pack
90102 shell : bash
91- run : build/build.sh prepack -platform $PLATFORM
103+ run : build/build.sh prepack -platform $PLATFORM -configuration $BUILD_CONFIGURATION
92104
93105 - name : Upload Artifacts
106+ # We only need a release version of this in the create_package job
107+ if : matrix.build-cfg == 'Release'
94108 uses : actions/upload-artifact@v4
95109 with :
96- name : intermediate
110+ name : intermediate-${{ matrix.build-cfg }}-${{ matrix.platform }}
97111 retention-days : 7
98112 overwrite : true
99113 path : |
@@ -110,6 +124,7 @@ jobs:
110124 env :
111125 DOTNET_NOLOGO : true
112126 DOTNET_CLI_TELEMETRY_OPTOUT : true
127+ BUILD_CONFIGURATION : Release
113128
114129 steps :
115130 - uses : actions/checkout@v4
@@ -121,15 +136,15 @@ jobs:
121136
122137 - uses : actions/download-artifact@v4
123138 with :
124- name : intermediate
139+ name : intermediate-Release-x64
125140
126141 - name : Setup
127142 shell : bash
128- run : build/build.sh generate_config
143+ run : build/build.sh generate_config -configuration $BUILD_CONFIGURATION
129144
130145 - name : Create package
131146 shell : bash
132- run : build/build.sh pack
147+ run : build/build.sh pack -configuration $BUILD_CONFIGURATION
133148
134149 - name : Upload package
135150 uses : actions/upload-artifact@v4
0 commit comments