@@ -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,54 +51,54 @@ 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)
7181 shell : bash
72- run : build/test.sh -platform $PLATFORM
82+ run : build/test.sh -platform $PLATFORM -configuration $BUILD_CONFIGURATION
7383
7484 - name : Build (QuickJS runtime)
85+ if : runner.os != 'Windows'
7586 shell : bash
7687 run : tests/quickjs/bootstrap.sh
77- if : runner.os != 'Windows'
7888
7989 - name : Test (QuickJS)
80- shell : bash
81- run : tests/quickjs/test.sh
8290 if : runner.os != 'Windows'
91+ shell : bash
92+ run : tests/quickjs/test.sh -dotnet_configuration $BUILD_CONFIGURATION
8393
8494 - name : Test (Emscripten)
85- shell : bash
86- run : tests/emscripten/test.sh
8795 if : runner.os != 'Windows'
96+ shell : bash
97+ run : tests/emscripten/test.sh -dotnet_configuration $BUILD_CONFIGURATION
8898
8999 - name : Pack
90100 shell : bash
91- run : build/build.sh prepack -platform $PLATFORM
101+ run : build/build.sh prepack -platform $PLATFORM -configuration $BUILD_CONFIGURATION
92102
93103 - uses : actions/upload-artifact@v3
94104 with :
@@ -107,6 +117,7 @@ jobs:
107117 env :
108118 DOTNET_NOLOGO : true
109119 DOTNET_CLI_TELEMETRY_OPTOUT : true
120+ BUILD_CONFIGURATION : Release
110121
111122 steps :
112123 - uses : actions/checkout@v4
@@ -122,11 +133,11 @@ jobs:
122133
123134 - name : Setup
124135 shell : bash
125- run : build/build.sh generate_config
136+ run : build/build.sh generate_config -configuration $BUILD_CONFIGURATION
126137
127138 - name : Create package
128139 shell : bash
129- run : build/build.sh pack
140+ run : build/build.sh pack -configuration $BUILD_CONFIGURATION
130141
131142 - name : Upload package
132143 uses : actions/upload-artifact@v3
0 commit comments