Add JavaScript Greeter/Context/Filesystem demos #432
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: ["main"] | |
# See https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
# env: | |
# Platform: x64 # For Msbuild | |
# Configuration: Release # For Msbuild | |
jobs: | |
ci: | |
name: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
ice_build_flags: srcs | |
- os: macos-14 | |
ice_build_flags: srcs | |
- os: windows-2022 | |
ice_build_flags: /t:BuildDist | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Windows Environment | |
if: runner.os == 'Windows' | |
run: | | |
# We need to replace \ with / in the path, specifically for Gradle | |
$iceHome = "${{ github.workspace }}/ice" | |
$iceHome = $iceHome.Replace("\", "/") | |
echo "ICE_HOME=$iceHome" >> $env:GITHUB_ENV | |
- name: Linux/MacOS Environment | |
if: runner.os != 'Windows' | |
run: | | |
echo "ICE_HOME=${{ github.workspace }}/ice" >> $GITHUB_ENV | |
- name: Checkout Ice | |
uses: actions/checkout@v4 | |
with: | |
repository: zeroc-ice/ice | |
ref: main | |
path: ice | |
- name: Setup Ice Build Dependencies | |
uses: ./ice/.github/actions/setup-dependencies | |
- name: Build Ice | |
uses: ./ice/.github/actions/build | |
timeout-minutes: 60 | |
with: | |
working_directory: ice | |
build_flags: ${{ runner.os == 'Windows' && '/t:BuildDist /p:Configuration=Release /p:Platform=x64' || 'srcs' }} | |
- name: Publish C# NuGet Packages | |
timeout-minutes: 5 | |
working-directory: ice/csharp/msbuild | |
run: dotnet msbuild ice.proj /t:Publish /p:Configuration=Release /p:Platform=x64 | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
path: ice-demos | |
- name: Build C++ Demos | |
timeout-minutes: 20 | |
working-directory: ice-demos/cpp | |
run: | | |
set -o pipefail | |
# No IceBT on macOS | |
if [[ "$(uname)" == "Darwin" ]]; then | |
rm -rf IceBT | |
fi | |
find . -name CMakeLists.txt -type f | while IFS= read -r file; do | |
dir=$(dirname "$file"); | |
cmake -B "$dir/build" -S "$dir" -DIce_DEBUG=ON -DCMAKE_BUILD_TYPE=Release | |
cmake --build "$dir/build" | |
done | |
if: runner.os != 'Windows' | |
- name: Build C++ Demos | |
timeout-minutes: 20 | |
working-directory: ice-demos/cpp | |
run: | | |
# No IceBT on Windows | |
Remove-Item -Recurse -Force "IceBT" | |
Get-ChildItem -Recurse -Filter CMakeLists.txt | ForEach-Object { | |
$dir = $_.DirectoryName | |
cmake -B "$dir/build" -S "$dir" -DIce_DEBUG=ON | |
cmake --build "$dir/build" --config Release | |
} | |
if: runner.os == 'Windows' | |
- name: Build C# Demos | |
timeout-minutes: 20 | |
working-directory: ice-demos/csharp | |
run: | | |
find . -name '*.sln' -type f | while IFS= read -r file; do | |
dotnet build "$file" | |
done | |
if: runner.os != 'Windows' | |
- name: Build C# Demos | |
timeout-minutes: 20 | |
working-directory: ice-demos/csharp | |
run: | | |
Get-ChildItem -Recurse -Filter *.sln | ForEach-Object { | |
dotnet build $_.FullName | |
} | |
if: runner.os == 'Windows' | |
- name: Run .NET format | |
working-directory: ice-demos/csharp | |
run: | | |
find . -name '*.sln' -type f | while IFS= read -r file; do | |
dotnet format --verify-no-changes "$file" | |
done | |
shell: bash | |
if: runner.os == 'Linux' | |
- name: Build Java Demos | |
timeout-minutes: 20 | |
working-directory: ice-demos/java | |
env: | |
# For Ice Builder for Gradle | |
CPP_PLATFORM: x64 | |
CPP_CONFIGURATION: Release | |
run: ./gradlew build | |
- name: Build JavaScript Demos | |
timeout-minutes: 20 | |
working-directory: ice-demos/js | |
run: | | |
set -euxo pipefail | |
find . -name package.json -type f | while IFS= read -r file; do | |
dir=$(dirname "$file"); | |
npm install --prefix "$dir" | |
npm run --prefix "$dir" build | |
done | |
if: runner.os != 'Windows' | |
- name: Build JavaScript Demos | |
timeout-minutes: 20 | |
working-directory: ice-demos/js | |
run: | | |
Get-ChildItem -Recurse -Filter package.json | ForEach-Object { | |
$dir = $_.DirectoryName | |
npm install --prefix "$dir" | |
if ($LASTEXITCODE -ne 0) { throw "npm install failed" } | |
npm run --prefix "$dir" build | |
if ($LASTEXITCODE -ne 0) { throw "npm build failed" } | |
} | |
if: runner.os == 'Windows' | |
- name: Build Swift Demos | |
timeout-minutes: 20 | |
working-directory: ice-demos/swift | |
run: | | |
set -o pipefail | |
find . -name Package.swift -type f | while IFS= read -r file; do | |
swift build --package-path "$(dirname "$file")" | |
done | |
if: runner.os == 'macOS' |