Skip to content

Commit

Permalink
Allow non-x64 architecture with LDC as default
Browse files Browse the repository at this point in the history
This allows supporting the new MacOS runners which runs on ARM.
  • Loading branch information
JohanEngelen authored and Geod24 committed Feb 2, 2024
1 parent 95d426d commit 0d1819b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ jobs:
dmd-master,
"",
]
include:
- os: macOS-latest
arch: arm64
dc: ""
- os: macos-latest
arch: arm64
dc: ldc-1.30.0
- os: macOS-latest
arch: arm64
dc: ldc-latest
- os: macOS-latest
arch: arm64
dc: ldc-beta
- os: macOS-latest
arch: arm64
dc: ldc-master

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import { existsSync } from 'fs';

async function run() {
try {
if (process.arch != "x64")
throw new Error("Only x64 arch is supported by all platforms");
let default_compiler = "dmd-latest";
if (process.arch != "x64") {
default_compiler = "ldc-latest";
}
const input = core.getInput('compiler') || default_compiler;
if (process.arch != "x64" && input.startsWith("dmd"))
throw new Error("The dmd compiler is not supported for non-x64 architecture");

const input = core.getInput('compiler') || "dmd-latest";
const gh_token = core.getInput('gh_token') || "";
const dub_version = core.getInput('dub') || "";
const descr = await compiler(input, dub_version, gh_token);
Expand Down

0 comments on commit 0d1819b

Please sign in to comment.