add linux github ci

This commit is contained in:
crazywhalecc
2023-04-08 21:20:22 +08:00
parent 000ebef28b
commit 298a758166
2 changed files with 71 additions and 52 deletions

View File

@@ -11,6 +11,14 @@ on:
- '8.2' - '8.2'
- '8.1' - '8.1'
- '8.0' - '8.0'
target:
required: true
default: 'cli'
type: choice
options:
- 'cli'
- 'micro'
- 'all'
extensions: extensions:
type: string type: string
debug: debug:
@@ -32,7 +40,38 @@ jobs:
# steps: # steps:
# - run: choco install ninja # - run: choco install ninja
# - run: ninja --version # - run: ninja --version
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo apt install musl-tools -y
- run: composer update --no-dev
# If there's no dependencies cache, fetch sources, with or without debug
- run: ./bin/spc fetch --with-php=${{ inputs.version }} --all --debug
# Run the build, with or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG='--debug'" >> $GITHUB_ENV
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
run: echo "SPC_BUILD_TARGET='--build-${{ inputs.target }}' >> $GITHUB_ENV
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_TARGET }}
- if: ${{ inputs.target == 'cli' || inputs.target == 'all' }}
uses: actions/upload-artifact@v3
with:
name: php-${{ inputs.version }}-linux
path: buildroot/bin/php
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
uses: actions/upload-artifact@v3
with:
name: micro-${{ inputs.version }}-linux
path: buildroot/bin/micro.sfx
mac: mac:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
@@ -66,12 +105,21 @@ jobs:
# Run the build, with or without debug # Run the build, with or without debug
- if: inputs.debug == true - if: inputs.debug == true
run: ./bin/spc build ${{ inputs.extensions }} --debug run: echo "SPC_BUILD_DEBUG='--debug'" >> $GITHUB_ENV
- if: inputs.debug == false - if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
run: ./bin/spc build ${{ inputs.extensions }} run: echo "SPC_BUILD_TARGET='--build-${{ inputs.target }}' >> $GITHUB_ENV
- uses: actions/upload-artifact@v3 - run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_TARGET }}
- if: ${{ inputs.target == 'cli' || inputs.target == 'all' }}
uses: actions/upload-artifact@v3
with: with:
name: php-${{ inputs.version }} name: php-${{ inputs.version }}-macos
path: buildroot/bin/php path: buildroot/bin/php
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
uses: actions/upload-artifact@v3
with:
name: micro-${{ inputs.version }}-macos
path: buildroot/bin/micro.sfx

View File

@@ -1,29 +0,0 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
/**
* is a template library class for unix
*/
class libuv extends MacOSLibraryBase
{
public const NAME = 'libuv';
protected function build()
{
[,,$destdir] = SEPARATED_PATH;
shell()->cd($this->source_dir)
->exec('./autogen.sh')
->exec(
"{$this->builder->configure_env} ./configure " .
'--enable-static --disable-shared ' .
'--prefix='
)
->exec('make clean')
->exec("make -j{$this->builder->concurrency}")
->exec("make install DESTDIR={$destdir}");
}
}