Skip to content

Commit

Permalink
Add Windows to node-ci and node-relase workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
tdcosta100 committed Feb 11, 2023
1 parent 1d20bb1 commit cce2e3b
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 98 deletions.
121 changes: 80 additions & 41 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ jobs:
arch: x86_64
- runs-on: macos-12-arm
arch: arm64
- runs-on: windows-2022
arch: x86_64
continue-on-error: true
env:
BUILDTYPE: ${{github.ref == 'refs/heads/main' && 'Release' || 'Debug'}}
Expand All @@ -72,21 +74,24 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Setup submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c core.longpaths=true -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive || true
- name: Get OS Architecture
if: runner.os == 'MacOS' || runner.os == 'Linux'
run: uname -m

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies macOS
if: runner.os == 'macOS'
- name: Install dependencies (MacOS)
if: runner.os == 'MacOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
Expand All @@ -98,7 +103,7 @@ jobs:
brew list glfw || brew install glfw
brew list libuv || brew install libuv
- name: Install dependencies Linux
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -118,61 +123,95 @@ jobs:
libc++abi-9-dev
/usr/sbin/update-ccache-symlinks
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: npm ci
run: npm ci --ignore-scripts

- name: Prepare ccache
run: ccache --clear --set-config cache_dir=~/.ccache
- name: Set up msvc dev cmd (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Cache ccache
uses: actions/cache@v3
env:
cache-name: ccache-v1
with:
path: ~/.ccache
key: ${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
restore-keys: |
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}
- name: Clear ccache statistics
- name: Update ccache (Windows)
if: runner.os == 'Windows'
run: |
ccache --zero-stats --set-config cache_dir=~/.ccache
ccache --max-size=2G --set-config cache_dir=~/.ccache
ccache --show-stats --set-config cache_dir=~/.ccache
choco.exe upgrade ccache
ccache.exe --version
echo "CCACHE_CONFIGPATH=C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf" >> $GITHUB_ENV
- name: CMake
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.runs-on }}

- name: Configure maplibre-gl-native (MacOS)
if: runner.os == 'MacOS'
run: |
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }}
cmake . -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
- name: CMake
- name: Configure maplibre-gl-native (Linux)
if: runner.os == 'Linux'
run: |
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
- name: Build
cmake . -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=gcc-10 \
-DCMAKE_CXX_COMPILER=g++-10
- name: Configure maplibre-gl-native (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
cmake . -B build ^
-G Ninja ^
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} ^
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache.exe
- name: Get disk space before build (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: Get-PSDrive -PSProvider FileSystem

- name: Build maplibre-gl-native (MacOS/Linux)
if: runner.os == 'MacOS' || runner.os == 'Linux'
run: |
cmake --build build -j $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)
- name: Run render tests on macOS
if: runner.os == 'macOS'
- name: Build maplibre-gl-native (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
cmake --build build
- name: Get disk space after build (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: Get-PSDrive -PSProvider FileSystem

- name: Run render tests on (MacOS)
if: runner.os == 'MacOS'
run: ./build/mbgl-render-test-runner --manifestPath metrics/macos-xcode11-release-style.json

- name: Upload render test artifacts
- name: Upload render test artifacts (MacOS)
if: runner.os == 'MacOS'
uses: actions/upload-artifact@v3
if: always()
with:
name: render-query-test-results
path: metrics/macos-xcode11-release-style.html

- name: Test
- name: Test (Linux)
if: runner.os == 'Linux'
run: xvfb-run --auto-servernum npm test

- name: Test
if: runner.os == 'macOS'
- name: Test (MacOS)
if: runner.os == 'MacOS'
run: npm test

# On PRs make sure that the npm package can be packaged.
Expand Down
116 changes: 59 additions & 57 deletions .github/workflows/node-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,27 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Get Latest Version
run: git pull

- name: Setup submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c core.longpaths=true -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 || true
- name: Get OS Architecture
if: runner.os == 'MacOS' || runner.os == 'Linux'
run: uname -m

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies macOS
if: runner.os == 'macOS'
- name: Install dependencies (MacOS)
if: runner.os == 'MacOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
Expand All @@ -99,7 +102,7 @@ jobs:
brew list glfw || brew install glfw
brew list libuv || brew install libuv
- name: Install dependencies Linux
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -119,68 +122,67 @@ jobs:
libc++abi-9-dev
/usr/sbin/update-ccache-symlinks
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: npm ci
run: npm ci --ignore-scripts

- name: Prepare ccache
run: ccache --clear --set-config cache_dir=~/.ccache
- name: Set up msvc dev cmd (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Cache ccache
uses: actions/cache@v3
env:
cache-name: ccache-v1
with:
path: ~/.ccache
key: ${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
restore-keys: |
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}-${{ github.ref }}
${{ env.cache-name }}-${{ matrix.os }}-${{ github.job }}
- name: Clear ccache statistics
- name: Update ccache (Windows)
if: runner.os == 'Windows'
run: |
ccache --zero-stats --set-config cache_dir=~/.ccache
ccache --max-size=2G --set-config cache_dir=~/.ccache
ccache --show-stats --set-config cache_dir=~/.ccache
choco.exe upgrade ccache
ccache.exe --version
echo "CCACHE_CONFIGPATH=C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf" >> $GITHUB_ENV
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.runs-on }}

- name: CMake
- name: Configure maplibre-gl-native (MacOS)
if: runner.os == 'MacOS'
run: |
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }}
cmake . -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
- name: CMake
- name: Configure maplibre-gl-native (Linux)
if: runner.os == 'Linux'
run: |
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
cmake . -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=gcc-10 \
-DCMAKE_CXX_COMPILER=g++-10
- name: Configure maplibre-gl-native (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
cmake . -B build ^
-G Ninja ^
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} ^
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache.exe
- name: Build
- name: Build maplibre-gl-native (MacOS/Linux)
if: runner.os == 'MacOS' || runner.os == 'Linux'
run: |
cmake --build build -j $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null)
#- name: Run render tests on macOS
# if: runner.os == 'macOS'
# run: ./build/mbgl-render-test-runner --manifestPath metrics/macos-xcode11-release-style.json

#- name: Upload render test artifacts
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: render-query-test-results
# path: metrics/macos-xcode11-release-style.html

#- name: Test
# if: runner.os == 'Linux'
# run: xvfb-run --auto-servernum npm test

#- name: Test
# if: runner.os == 'macOS' && matrix.arch != 'arm64'
# run: npm test

# On PRs make sure that the npm package can be packaged.
#- name: Pack
# if: github.ref != 'refs/heads/main'
# run: |
# npm pack --dry-run
- name: Build maplibre-gl-native (Windows)
if: runner.os == 'Windows'
shell: cmd
run: |
cmake --build build
- name: Publish X64 Release to Github
if: github.ref == 'refs/heads/main' && matrix.arch == 'x86_64'
Expand Down

0 comments on commit cce2e3b

Please sign in to comment.