Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Test latest version
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]

steps:
- name: Checkout
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
cmake_ver: ['', '3.19.3', '3.15.1', '2.8']
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
cmake_ver: ['', '3.28.6', '3.19.3', '3.15.1', '2.8']
exclude: # Some of these versions are missing
- os: ubuntu-24.04-arm
cmake_ver: '3.15.1'
- os: ubuntu-24.04-arm
cmake_ver: '2.8'

steps:
- name: Checkout
Expand Down Expand Up @@ -47,7 +52,7 @@ jobs:
name: Unit Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]

steps:
- name: Setup node
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Test latest version
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-32bit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
cmake_ver: ['', '3.19.3', '3.15.1', '2.8']
cmake_ver: ['', '3.28.6', '3.19.3', '3.15.1', '2.8']

steps:
- name: Checkout
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ There are three options for the action:

Possible values are `true` or `false`. The default is `false`.

* `arch-series` forces a particular architecture series - eg arm or x86. This
changes the interpretation of use-32bit.

Possible values are 'x86' (or 'x86_64') and 'arm' (or 'arm64'). Default is
based on the architecture from the runner.

### How it works

The action will download the list of releases of CMake available on GitHub and
Expand Down
4 changes: 2 additions & 2 deletions __tests__/version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ describe('When providing multiple different archs', () => {
});
});

it('correctly parses the aarch86 archive', async () => {
it('correctly parses the aarch64 archive', async () => {
const version_info = await version.getAllVersionInfo();
const selected = version.getLatestMatching('3.x', version_info);
const assets = selected.assets;
Expand All @@ -298,7 +298,7 @@ describe('When providing multiple different archs', () => {
expect(macosAsset).toEqual({
name: 'cmake-3.19.3-Linux-aarch64.tar.gz',
platform: 'linux',
arch: '',
arch: 'arm64',
Comment on lines 298 to +301

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This macos switch is indicative of the "macos == non-x86" issue. I don't really know how to work around it

filetype: 'archive',
url: 'https://fakeaddress.com/cmake-3.19.3-Linux-aarch64.tar.gz',
});
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ inputs:
use-32bit:
description: 'Force using 32 bit version of cmake, instead of looking for 64 bit version'
default: 'false'
arch-series:
description: 'Architecture series - could be x86, x86_64, arm, arm64 - defaults to arch of runner'
default: '${{ runner.arch }}'
Comment on lines +13 to +15

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only here to force runner.arch to be available - if you know how to query it from ts please let me know and I'll rework it

runs:
using: 'node20'
main: 'dist/index.js'
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ async function run() {
core.info(`Using cmake version ${chosen_version_info.name}`);

const use_32bits = core.getInput('use-32bit').toLowerCase() === 'true';
const arch_candidates = use_32bits ? ['x86'] : ['x86_64', 'x86'];
let arch_candidates = use_32bits ? ['x86'] : ['x86_64', 'x86'];

switch (core.getInput('arch-series').toLowerCase()) {
case 'arm':
case 'arm64':
arch_candidates = use_32bits ? ['arm'] : ['arm64', 'aarch64'];
break;
}

await setup.addCMakeToPath(chosen_version_info, arch_candidates);
} catch (error) {
Expand Down
4 changes: 4 additions & 0 deletions src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ function extractArchFrom(filename: string): string {
return 'x86';
} else if (filename.match(/i386/)) {
return 'x86';
} else if (filename.match(/arm64/)) {
return 'arm64';
} else if (filename.match(/aarch64/)) {
return 'arm64';
} else {
return '';
}
Expand Down