Skip to content

Commit

Permalink
CI/CD: special treatment for Windows on ARM.
Browse files Browse the repository at this point in the history
Indeed, GHA doesn't currently have WoA runners.
  • Loading branch information
agarny committed Jan 30, 2025
1 parent 8f81d90 commit 8e27c8a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 18 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,16 @@ jobs:
include:
- name: Windows (Intel)
os: windows-2022
node_architecture: x64
- name: Windows (ARM)
os: windows-2019
node_architecture: arm64
- name: Linux (Intel)
os: ubuntu-22.04
node_architecture: x64
- name: Linux (ARM)
os: ubuntu-22.04-arm
node_architecture: arm64
- name: macOS (Intel)
os: macos-13
node_architecture: x64
- name: macOS (ARM)
os: macos-14
node_architecture: arm64
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
Expand Down Expand Up @@ -66,7 +60,6 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
architecture: ${{ matrix.node_architecture }}
node-version: 'lts/*'
- name: Install pnpm
run: npm install -g pnpm
Expand All @@ -77,8 +70,26 @@ jobs:
sudo apt install libopenjp2-tools
- name: OpenCOR dependencies
run: pnpm install
- name: Package OpenCOR
- name: Fix OpenCOR's dependencies (Windows on ARM only)
if: ${{ (matrix.name == 'Windows (ARM)') }}
run: |
choco install wget unzip
cd node_modules/electron
Remove-Item -Recurse -Force dist
mkdir dist
cd dist
wget https://github.com/electron/electron/releases/download/v34.0.2/electron-v34.0.2-win32-arm64.zip -O electron.zip
unzip electron.zip
del electron.zip
- name: Package OpenCOR (all platforms except Windows on ARM)
if: ${{ matrix.name != 'Windows (ARM)' }}
run: pnpm package
- name: Package OpenCOR (Windows on ARM only)
if: ${{ matrix.name == 'Windows (ARM)' }}
run: |
pnpm cmake-js build -a arm64 -B Release -O out/libOpenCOR
pnpm electron-vite build
pnpm electron-builder --arm64
- name: Remove blockmap files
shell: bash
run: find ./dist -name '*.blockmap' -delete
Expand Down
30 changes: 20 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,20 @@ jobs:
include:
- name: Windows (Intel)
os: windows-2022
node_architecture: x64
- name: Windows (ARM)
os: windows-2019
node_architecture: arm64
- name: Linux (Intel)
os: ubuntu-22.04
node_architecture: x64
- name: Linux (ARM)
os: ubuntu-22.04-arm
node_architecture: arm64
- name: macOS (Intel)
os: macos-13
node_architecture: x64
- name: macOS (ARM)
os: macos-14
node_architecture: arm64
- name: Code formatting
os: ubuntu-22.04
node_architecture: x64
- name: Linting
os: ubuntu-22.04
node_architecture: x64
steps:
- name: Check out OpenCOR
uses: actions/checkout@v4
Expand All @@ -45,15 +37,33 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
architecture: ${{ matrix.node_architecture }}
node-version: 'lts/*'
- name: Install pnpm
run: npm install -g pnpm
- name: OpenCOR dependencies
run: pnpm install
- name: Build OpenCOR
- name: Fix OpenCOR's dependencies (Windows on ARM only)
if: ${{ matrix.name == 'Windows (ARM)' }}
run: |
choco install wget unzip
cd node_modules/electron
Remove-Item -Recurse -Force dist
mkdir dist
cd dist
wget https://github.com/electron/electron/releases/download/v34.0.2/electron-v34.0.2-win32-arm64.zip -O electron.zip
unzip electron.zip
del electron.zip
- name: Build OpenCOR (all platforms except Windows on ARM)
if: ${{ (matrix.name != 'Code formatting') && (matrix.name != 'Linting') }}
run: pnpm build
- name: Build OpenCOR (all platforms except Windows on ARM)
if: ${{ (matrix.name != 'Windows (ARM)') && (matrix.name != 'Code formatting') && (matrix.name != 'Linting') }}
run: pnpm build
- name: Build OpenCOR (Windows on ARM only)
if: ${{ matrix.name == 'Windows (ARM)' }}
run: |
pnpm cmake-js build -a arm64 -B Release -O out/libOpenCOR
pnpm electron-vite build
- name: Build OpenCOR's Web app
if: ${{ (matrix.name != 'Code formatting') && (matrix.name != 'Linting') }}
run: pnpm build:web
Expand Down

0 comments on commit 8e27c8a

Please sign in to comment.