Skip to content

Commit 8bcdf0b

Browse files
committed
[Test] multiple config CI build
1 parent 979d90b commit 8bcdf0b

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

.github/workflows/main.yml

+30-19
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,34 @@ name: CI
22

33
on: [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+
510
jobs:
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,35 +51,35 @@ 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)
7585
shell: bash
@@ -88,7 +98,7 @@ jobs:
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

Comments
 (0)