Skip to content

Keyman Core - ARM64/Windows test - PR-12893 by @mcdurdin #561

Keyman Core - ARM64/Windows test - PR-12893 by @mcdurdin

Keyman Core - ARM64/Windows test - PR-12893 by @mcdurdin #561

#
# This workflow tests Keyman Core on ARM64/Windows; we cannot use our TeamCity
# agents because we have no ARM64 Windows agents.
#
# It is triggered by a repository_dispatch event with the type
# `core-arm64-windows-test:*`.
#
name: "Keyman Core - ARM64/Windows test"
run-name: "Keyman Core - ARM64/Windows test - ${{ github.event.client_payload.branch }} by @${{ github.event.client_payload.user }}"
on:
repository_dispatch:
types: ['core-arm64-windows-test:*']
# Inputs:
#
# buildSha: The SHA of the commit to build, e.g. of the branch or
# refs/pull/1234/head for PR
# isTestBuild: true for PR and test builds, false for release builds
# force: true to run this action on a fork of keymanapp/keyman
#
# Descriptive inputs:
#
# branch: Name of the branch to build, generally, `master`, `beta`,
# `stable-x.y`, or for a PR `#1234`. Used only in the action
# title
# user: The user that triggered the build or created the PR. Used
# only in the action title
env:
GH_TOKEN: ${{ github.token }}
STATUS_CONTEXT: 'Keyman Core - ARM64 test'
_builder_timings: false
jobs:
core-arm64-windows-test:
name: Keyman Core ARM64/Windows test
if: github.repository == 'keymanapp/keyman' || github.event.client_payload.force
runs-on: windows-11-arm
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: '${{ github.event.client_payload.buildSha }}'
- name: Set pending status on PR builds
id: set_status
if: github.event.client_payload.isTestBuild == 'true'
shell: bash
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
repos/$GITHUB_REPOSITORY/statuses/${{ github.event.client_payload.buildSha }} \
-f state='pending' \
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
-f description='Keyman Core - ARM64 test started' \
-f context="$STATUS_CONTEXT"
- name: Report initial npm/node versions
run: |
echo "Initial npm/node versions"
npm -v
node -v
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.13'
- uses: actions/setup-node@v6
with:
# This needs to be kept in sync with minimum-versions.sh
node-version: '20.19'
# As of Dec 2025, ngrok not yet supported on ARM Windows,
# google-closure-compiler (and others?) does not support arm64 yet, so
# use the x64 version of node. This is needed to avoid `npm ci` failure,
# even though we don't use ngrok directly; google-closure-compiler is
# used by emscripten
architecture: x64
- name: Report on current environment
shell: bash
run: |
echo "-- Environment --"
echo "pythonLocation=$pythonLocation"
echo "-- Current npm/node versions --"
npm -v
node -v
- name: Setup environment
shell: bash
run: |
# As of Dec 2025, Emscripten does not support Win11 ARM natively
echo "EMSDK_ARCH=x86_64" >> $GITHUB_ENV
echo "EMSDK_KEEP_DOWNLOADS=1" >> $GITHUB_ENV
echo "KEYMAN_USE_EMSDK=1" >> $GITHUB_ENV
echo "PATH=$PATH:$pythonLocation/Scripts" >> $GITHUB_ENV
echo "KEYMAN_CI_SKIP_NVM=1" >> $GITHUB_ENV
- name: Install emscripten
shell: bash
run: |
source resources/build/minimum-versions.inc.sh
mkdir ../emsdk
pushd ../emsdk
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install "${KEYMAN_MIN_VERSION_EMSCRIPTEN}"
./emsdk activate "${KEYMAN_MIN_VERSION_EMSCRIPTEN}"
cd upstream/emscripten
npm install
echo "EMSCRIPTEN_BASE=$(pwd)" >> $GITHUB_ENV
popd
- name: Install meson
shell: bash
run: |
pip3 install --user meson==1.10.1
- name: Run test
shell: bash
run: |
# Run the test
./core/build.sh configure,build,test:arm64
set_status:
name: Set result status on PR builds
needs: [core-arm64-windows-test]
runs-on: windows-11-arm
if: ${{ always() && github.event.client_payload.isTestBuild == 'true' }}
steps:
- name: Set success
if: needs.core-arm64-windows-test.result == 'success'
shell: bash
run: |
echo "RESULT=success" >> $GITHUB_ENV
echo "MSG=Keyman Core ARM64 test succeeded" >> $GITHUB_ENV
- name: Set cancelled
if: needs.core-arm64-windows-test.result == 'cancelled'
shell: bash
run: |
echo "RESULT=error" >> $GITHUB_ENV
echo "MSG=Keyman Core ARM64 test cancelled" >> $GITHUB_ENV
- name: Set failure
if: needs.core-arm64-windows-test.result == 'failure'
shell: bash
run: |
echo "RESULT=failure" >> $GITHUB_ENV
echo "MSG=Keyman Core ARM64 test failed" >> $GITHUB_ENV
- name: Set final status
shell: bash
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
repos/$GITHUB_REPOSITORY/statuses/${{ github.event.client_payload.buildSha }} \
-f state="$RESULT" \
-f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
-f description="$MSG" \
-f context="$STATUS_CONTEXT"