Skip to content

Speed up arm64 builds with native arm64 runner #223

Speed up arm64 builds with native arm64 runner

Speed up arm64 builds with native arm64 runner #223

Workflow file for this run

name: test
on:
pull_request:
branches:
- main
env:
APP_NAME: 'manticore-executor'
PHP_VERSION: '8.3.4'
MAINTAINER: 'Manticore'
DESC: 'Custom built PHP executor for Manticore.'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- job_name: 'Build static in Alpine'
os: ubuntu-22.04
use_docker: true
script_name: ./build-alpine
- job_name: 'Build dev version in Jammy'
os: ubuntu-22.04
use_docker: false
script_name: ./build-linux
- job_name: 'Build static on amd64 OSX'
os: macos-13
use_docker: false
script_name: ./build-osx
- job_name: 'Build static on arm64 OSX'
os: macos-14
use_docker: false
script_name: ./build-osx
steps:
- uses: actions/checkout@v3
- uses: ilammy/[email protected]
with:
uwp: true
- name: Build binary using host OS
if: ${{ matrix.use_docker == false }}
run: ${{ matrix.script_name }} ${{ env.PHP_VERSION }}
- name: Build binary using Docker
if: ${{ matrix.use_docker == true }}
run: docker run -v ${PWD}:/src -w /src alpine:3.17 sh -c "apk add sudo bash; ${{ matrix.script_name }} ${{ env.PHP_VERSION }}"
- name: Create artifact
run: |
os="${{ runner.os }}"
assets="${{ env.APP_NAME }}_$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')_amd64"
echo "$assets"
mkdir -p "dist/$assets"
if [[ "${{ runner.os }}" == Windows ]]; then
mv build/dist/php.exe build/dist/${{ env.APP_NAME }}.exe
cp build/dist/* "dist/$assets/"
else
cp build/dist/bin/php "dist/$assets/${{ env.APP_NAME }}"
fi
cp README.* "dist/$assets/"
(
cd dist
if [[ "${{ runner.os }}" == Windows ]]; then
7z a "$assets.zip" "$assets"
else
tar czf "$assets.tar.gz" "$assets"
fi
ls -lah *.*
)
shell: bash
- uses: actions/upload-artifact@v3
with:
name: artifact-${{ matrix.os }}-amd64
path: |
dist/*.tar.gz
dist/*.zip