Skip to content

Arch Specification

Arch Specification #22

Workflow file for this run

name: Build, Test and Verify Executables
on:
push:
branches:
- build/executables
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
include:
- os: ubuntu-latest
output-name: commanddash-linux
- os: macOS-latest
output-name: commanddash-mac
- os: windows-latest
output-name: commanddash-windows.exe
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- name: Dart pub get
run: |
cd commanddash
mkdir -p build
dart pub get
- name: Compile
run: |
cd commanddash
dart compile exe bin/commanddash.dart -o build/${{ matrix.output-name }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.output-name }} # Dynamically name the artifact based on the OS
path: commanddash/build/${{ matrix.output-name }}
test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
binary-name: commanddash-linux
- os: windows-latest
binary-name: commanddash-windows.exe
- os: macos-latest
binary-name: commanddash-mac
macos-arch: x64
- os: macos-latest
binary-name: commanddash-mac
macos-arch: arm64
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.binary-name }}
path: ./executable
# Ensure binary is executable, skipping this for Windows
- name: Make binary executable
if: matrix.os != 'windows-latest'
run: chmod +x ./executable/${{ matrix.binary-name }}
# Execute a basic command or test for non-macOS, simplified for demonstration
- name: Test binary (macOS)
if: matrix.os == 'macos-latest'
run: |
if [[ "${{ matrix.macos-arch }}" == "arm64" ]]; then
arch -arm64 ./executable/${{ matrix.binary-name }} --help
else
./executable/${{ matrix.binary-name }} --help
fi