|
|
|
@ -2,24 +2,34 @@ name: CI |
|
|
|
|
|
|
|
|
|
|
|
on: [push, pull_request] |
|
|
|
on: [push, pull_request] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Cancel any previous workflows if the pull request was updated |
|
|
|
|
|
|
|
concurrency: |
|
|
|
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} |
|
|
|
|
|
|
|
cancel-in-progress: true |
|
|
|
|
|
|
|
|
|
|
|
jobs: |
|
|
|
jobs: |
|
|
|
build: |
|
|
|
build: |
|
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository |
|
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository |
|
|
|
strategy: |
|
|
|
strategy: |
|
|
|
fail-fast: false |
|
|
|
fail-fast: false |
|
|
|
matrix: |
|
|
|
matrix: |
|
|
|
config: |
|
|
|
os: [ubuntu-22.04, macos-12, windows-2022] |
|
|
|
- { os: ubuntu-22.04, platform: x64, cxx: g++-11, cc: gcc-11 } |
|
|
|
platform: [x64] |
|
|
|
- { os: macos-12, platform: x64, cxx: clang++, cc: clang } |
|
|
|
build-cfg: [DebugOpt, Release] |
|
|
|
- { os: windows-2022, platform: x64, vs: "Program Files/Microsoft Visual Studio/2022" } |
|
|
|
#build-cfg: [Debug, DebugOpt, Release] # our local copy of clang isn't build for debug on linux/macos currently |
|
|
|
|
|
|
|
include: |
|
|
|
|
|
|
|
- os: windows-2022 |
|
|
|
|
|
|
|
platform: x64 |
|
|
|
|
|
|
|
build-cfg: Debug |
|
|
|
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.config.os }} |
|
|
|
runs-on: ${{ matrix.os }} |
|
|
|
|
|
|
|
|
|
|
|
env: |
|
|
|
env: |
|
|
|
CC: ${{ matrix.config.cc }} |
|
|
|
CC: ${{ startsWith(matrix.os, 'ubuntu') && 'gcc-11' || 'clang' }} |
|
|
|
CXX: ${{ matrix.config.cxx }} |
|
|
|
CXX: ${{ startsWith(matrix.os, 'ubuntu') && 'g++-11' || 'clang++' }} |
|
|
|
VS_VERSION: ${{ matrix.config.vs }} |
|
|
|
VS_VERSION: "Program Files/Microsoft Visual Studio/2022" |
|
|
|
PLATFORM: ${{ matrix.config.platform }} |
|
|
|
PLATFORM: ${{ matrix.platform }} |
|
|
|
|
|
|
|
BUILD_CONFIGURATION: ${{ matrix.build-cfg }} |
|
|
|
DOTNET_NOLOGO: true |
|
|
|
DOTNET_NOLOGO: true |
|
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true |
|
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true |
|
|
|
EMSCRIPTEN_VERSION: 3.1.65 |
|
|
|
EMSCRIPTEN_VERSION: 3.1.65 |
|
|
|
@ -41,7 +51,7 @@ jobs: |
|
|
|
cmake-version: '3.30.x' |
|
|
|
cmake-version: '3.30.x' |
|
|
|
|
|
|
|
|
|
|
|
- name: Install nbgv |
|
|
|
- name: Install nbgv |
|
|
|
if: startsWith(matrix.config.os, 'macos') |
|
|
|
if: startsWith(matrix.os, 'macos') |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
dotnet tool install -g nbgv |
|
|
|
dotnet tool install -g nbgv |
|
|
|
|
|
|
|
|
|
|
|
@ -49,46 +59,46 @@ jobs: |
|
|
|
run: nbgv cloud --all-vars |
|
|
|
run: nbgv cloud --all-vars |
|
|
|
|
|
|
|
|
|
|
|
- name: Environment |
|
|
|
- name: Environment |
|
|
|
if: matrix.config.vs |
|
|
|
if: startsWith(matrix.os, 'windows') |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
run: echo "/c/$VS_VERSION/Enterprise/MSBuild/Current/Bin" >> $GITHUB_PATH |
|
|
|
run: echo "/c/$VS_VERSION/Enterprise/MSBuild/Current/Bin" >> $GITHUB_PATH |
|
|
|
|
|
|
|
|
|
|
|
- name: Setup |
|
|
|
- name: Setup |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
build/build.sh generate -platform $PLATFORM |
|
|
|
build/build.sh generate -platform $PLATFORM -configuration $BUILD_CONFIGURATION |
|
|
|
build/build.sh download_llvm -platform $PLATFORM |
|
|
|
build/build.sh download_llvm -platform $PLATFORM -configuration $BUILD_CONFIGURATION |
|
|
|
|
|
|
|
|
|
|
|
- name: Restore |
|
|
|
- name: Restore |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
run: build/build.sh restore -platform $PLATFORM |
|
|
|
run: build/build.sh restore -platform $PLATFORM -configuration $BUILD_CONFIGURATION |
|
|
|
|
|
|
|
|
|
|
|
- name: Build |
|
|
|
- name: Build |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
run: build/build.sh -platform $PLATFORM -build_only |
|
|
|
run: build/build.sh -platform $PLATFORM -build_only -configuration $BUILD_CONFIGURATION |
|
|
|
|
|
|
|
|
|
|
|
- name: Test (.NET) |
|
|
|
- name: Test (.NET) |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
run: build/test.sh -platform $PLATFORM |
|
|
|
run: build/test.sh -platform $PLATFORM -configuration $BUILD_CONFIGURATION |
|
|
|
|
|
|
|
|
|
|
|
- name: Build (QuickJS runtime) |
|
|
|
- name: Build (QuickJS runtime) |
|
|
|
|
|
|
|
if: runner.os != 'Windows' |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
run: tests/quickjs/bootstrap.sh |
|
|
|
run: tests/quickjs/bootstrap.sh |
|
|
|
if: runner.os != 'Windows' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Test (QuickJS) |
|
|
|
- name: Test (QuickJS) |
|
|
|
shell: bash |
|
|
|
|
|
|
|
run: tests/quickjs/test.sh |
|
|
|
|
|
|
|
if: runner.os != 'Windows' |
|
|
|
if: runner.os != 'Windows' |
|
|
|
|
|
|
|
shell: bash |
|
|
|
|
|
|
|
run: tests/quickjs/test.sh -dotnet_configuration $BUILD_CONFIGURATION |
|
|
|
|
|
|
|
|
|
|
|
- name: Test (Emscripten) |
|
|
|
- name: Test (Emscripten) |
|
|
|
shell: bash |
|
|
|
|
|
|
|
run: tests/emscripten/test.sh |
|
|
|
|
|
|
|
if: runner.os != 'Windows' |
|
|
|
if: runner.os != 'Windows' |
|
|
|
|
|
|
|
shell: bash |
|
|
|
|
|
|
|
run: tests/emscripten/test.sh -dotnet_configuration $BUILD_CONFIGURATION |
|
|
|
|
|
|
|
|
|
|
|
- name: Pack |
|
|
|
- name: Pack |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
run: build/build.sh prepack -platform $PLATFORM |
|
|
|
run: build/build.sh prepack -platform $PLATFORM -configuration $BUILD_CONFIGURATION |
|
|
|
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3 |
|
|
|
- uses: actions/upload-artifact@v3 |
|
|
|
with: |
|
|
|
with: |
|
|
|
@ -107,6 +117,7 @@ jobs: |
|
|
|
env: |
|
|
|
env: |
|
|
|
DOTNET_NOLOGO: true |
|
|
|
DOTNET_NOLOGO: true |
|
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true |
|
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: true |
|
|
|
|
|
|
|
BUILD_CONFIGURATION: Release |
|
|
|
|
|
|
|
|
|
|
|
steps: |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v4 |
|
|
|
- uses: actions/checkout@v4 |
|
|
|
@ -122,11 +133,11 @@ jobs: |
|
|
|
|
|
|
|
|
|
|
|
- name: Setup |
|
|
|
- name: Setup |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
run: build/build.sh generate_config |
|
|
|
run: build/build.sh generate_config -configuration $BUILD_CONFIGURATION |
|
|
|
|
|
|
|
|
|
|
|
- name: Create package |
|
|
|
- name: Create package |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
run: build/build.sh pack |
|
|
|
run: build/build.sh pack -configuration $BUILD_CONFIGURATION |
|
|
|
|
|
|
|
|
|
|
|
- name: Upload package |
|
|
|
- name: Upload package |
|
|
|
uses: actions/upload-artifact@v3 |
|
|
|
uses: actions/upload-artifact@v3 |
|
|
|
|