CI: add Linux arm64 build #204
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2024 Soulfind Contributors | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
name: Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
os: [linux-x86_64, linux-arm64, macos-x86_64, macos-arm64, windows-x86_64] | |
compiler: [ldc, dmd] | |
type: [release, debug] | |
include: | |
- os: linux-x86_64 | |
image: ubuntu-latest | |
container: alpine:edge | |
- os: linux-arm64 | |
image: ubuntu-24.04-arm | |
container: alpine:edge | |
- os: macos-x86_64 | |
image: macos-13 | |
target: 10.12 | |
- os: macos-arm64 | |
image: macos-latest | |
target: 11 | |
- os: windows-x86_64 | |
image: windows-latest | |
- os: linux-x86_64 | |
compiler: ldc | |
dflags: -static -preview=all | |
- type: debug | |
flags: --debug=db --debug=msg --debug=user | |
- compiler: ldc | |
dflags: -preview=all | |
exclude: | |
- os: linux-arm64 | |
compiler: dmd | |
- os: macos-arm64 | |
compiler: dmd | |
runs-on: ${{ matrix.image }} | |
container: ${{ matrix.container }} | |
env: | |
DFLAGS: ${{ matrix.dflags }} | |
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.target }} | |
steps: | |
# Workaround from https://github.com/actions/runner/issues/801#issuecomment-2394392502 | |
- name: Patch native Alpine NodeJS into Runner environment | |
if: matrix.os == 'linux-arm64' | |
run: | | |
apk add docker nodejs | |
sed -i "s:ID=alpine:ID=NotpineForGHA:" /etc/os-release | |
docker run --rm -v /:/host alpine sh -c 'cd /host/home/runner/runners/*/externals/ && rm -rf node20/* && mkdir node20/bin && ln -s /usr/bin/node node20/bin/node' | |
shell: sh | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up D (Linux) | |
if: runner.os == 'Linux' | |
run: apk add ${{ matrix.compiler }} dub gcc musl-dev sqlite-static | |
- name: Set up D (Other) | |
if: runner.os != 'Linux' | |
uses: dlang-community/setup-dlang@v2 | |
with: | |
compiler: ${{ matrix.compiler }} | |
- name: Build | |
run: dub build -v --build=${{ matrix.type }} ${{ matrix.flags }} | |
- name: Sign binaries (macOS) | |
if: runner.os == 'macOS' | |
run: codesign -s - bin/* | |
- name: Archive artifacts | |
if: matrix.compiler == 'ldc' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: soulfind-${{ matrix.os }}-${{ matrix.type }} | |
path: bin |