Iterate ARM support in CI (#587)

This commit is contained in:
Michael Telatynski 2023-03-23 13:22:29 +00:00 committed by GitHub
parent 7a1a0fabdb
commit 1654030c5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 9 deletions

View file

@ -19,7 +19,7 @@ jobs:
uses: ./.github/workflows/build_windows.yaml uses: ./.github/workflows/build_windows.yaml
strategy: strategy:
matrix: matrix:
arch: [x64, x86, arm64] arch: [x64, x86]
with: with:
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
@ -92,7 +92,7 @@ jobs:
if: matrix.prepare_cmd if: matrix.prepare_cmd
- name: Run tests - name: Run tests
uses: GabrielBB/xvfb-action@v1 uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
timeout-minutes: 5 timeout-minutes: 5
with: with:
run: "yarn test" run: "yarn test"

View file

@ -38,6 +38,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
default: true
toolchain: stable toolchain: stable
- name: Install libsqlcipher-dev - name: Install libsqlcipher-dev

View file

@ -54,6 +54,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
default: true
toolchain: stable toolchain: stable
target: aarch64-apple-darwin target: aarch64-apple-darwin

View file

@ -68,7 +68,7 @@ jobs:
id: cache id: cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
key: ${{ runner.os }}-${{ hashFiles('hakDependencies.json', 'electronVersion') }} key: ${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('hakDependencies.json', 'electronVersion') }}
path: | path: |
./.hak ./.hak
@ -97,6 +97,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
default: true
toolchain: stable toolchain: stable
target: ${{ steps.config.outputs.target }} target: ${{ steps.config.outputs.target }}

View file

@ -22,6 +22,15 @@ import fsExtra from "fs-extra";
import HakEnv from "../../scripts/hak/hakEnv"; import HakEnv from "../../scripts/hak/hakEnv";
import { DependencyInfo } from "../../scripts/hak/dep"; import { DependencyInfo } from "../../scripts/hak/dep";
type WinConfiguration =
| "VC-WIN32"
| "VC-WIN64A"
| "VC-WIN64-ARM"
| "VC-WIN64-CLANGASM-ARM"
| "VC-CLANG-WIN64-CLANGASM-ARM"
| "VC-WIN32-HYBRIDCRT"
| "VC-WIN64A-HYBRIDCRT";
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
if (hakEnv.isWin()) { if (hakEnv.isWin()) {
await buildOpenSslWin(hakEnv, moduleInfo); await buildOpenSslWin(hakEnv, moduleInfo);
@ -36,7 +45,18 @@ async function buildOpenSslWin(hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
const version = moduleInfo.cfg.dependencies.openssl; const version = moduleInfo.cfg.dependencies.openssl;
const openSslDir = path.join(moduleInfo.moduleTargetDotHakDir, `openssl-${version}`); const openSslDir = path.join(moduleInfo.moduleTargetDotHakDir, `openssl-${version}`);
const openSslArch = hakEnv.getTargetArch() === "x64" ? "VC-WIN64A" : "VC-WIN32"; let openSslArch: WinConfiguration;
switch (hakEnv.getTargetArch()) {
case "x64":
openSslArch = "VC-WIN64A";
break;
case "ia32":
openSslArch = "VC-WIN32";
break;
case "arm64":
openSslArch = "VC-WIN64-ARM";
break;
}
console.log("Building openssl in " + openSslDir); console.log("Building openssl in " + openSslDir);
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {

View file

@ -100,10 +100,10 @@ const x8664PcWindowsMsvc: WindowsTarget = {
}; };
const aarch64WindowsMsvc: WindowsTarget = { const aarch64WindowsMsvc: WindowsTarget = {
id: 'aarch64-pc-windows-msvc', id: "aarch64-pc-windows-msvc",
platform: 'win32', platform: "win32",
arch: 'arm64', arch: "arm64",
vcVarsArch: 'arm64', vcVarsArch: "arm64",
}; };
const x8664UnknownLinuxGnu: LinuxTarget = { const x8664UnknownLinuxGnu: LinuxTarget = {
@ -170,7 +170,7 @@ export const TARGETS: Record<TargetId, Target> = {
// Windows // Windows
"i686-pc-windows-msvc": i686PcWindowsMsvc, "i686-pc-windows-msvc": i686PcWindowsMsvc,
"x86_64-pc-windows-msvc": x8664PcWindowsMsvc, "x86_64-pc-windows-msvc": x8664PcWindowsMsvc,
'aarch64-pc-windows-msvc': aarch64WindowsMsvc, "aarch64-pc-windows-msvc": aarch64WindowsMsvc,
// Linux // Linux
"i686-unknown-linux-musl": i686UnknownLinuxMusl, "i686-unknown-linux-musl": i686UnknownLinuxMusl,
"i686-unknown-linux-gnu": i686UnknownLinuxGnu, "i686-unknown-linux-gnu": i686UnknownLinuxGnu,