This commit is contained in:
crazywhalecc
2023-04-08 22:15:48 +08:00
parent bb52b87d2f
commit feb20fad83
2 changed files with 13 additions and 16 deletions

View File

@@ -49,37 +49,34 @@ jobs:
echo "SPC_BUILD_OS=linux" >> $GITHUB_ENV
# Cache composer dependencies
- id: cache-${{ matrix.operating-system }}-composer-deps
- id: cache-composer-deps
uses: actions/cache@v3
with:
path: vendor
key: ${{ matrix.operating-system }}-composer-dependencies
key: composer-dependencies
# If there's no Composer cache, install dependencies
- if: steps.cache-${{ matrix.operating-system }}-composer-deps.outputs.cache-hit != 'true'
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
run: composer update --no-dev
# Cache downloaded source
- id: cache-${{ matrix.operating-system }}-build-deps
- id: cache-download
uses: actions/cache@v3
with:
path: source
key: ${{ matrix.operating-system }}-php-${{ inputs.version }}-dependencies
path: downloads
key: php-${{ inputs.version }}-dependencies
# With or without debug
- if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG='--debug'" >> $GITHUB_ENV
# If there's no dependencies cache, fetch sources, with or without debug
- if: ${{ steps.cache-${{ matrix.operating-system }}-build-deps.outputs.cache-hit != 'true' && inputs.debug == true }}
run: ./bin/spc fetch --with-php=${{ inputs.version }} --all --debug
- if: ${{ steps.cache-${{ matrix.operating-system }}-build-deps.outputs.cache-hit != 'true' && inputs.debug == false }}
run: ./bin/spc fetch --with-php=${{ inputs.version }} --all
# Build target select: cli, micro or both
# With target select: cli, micro or both
- if: ${{ inputs.target == 'micro' || inputs.target == 'all' }}
run: echo "SPC_BUILD_TARGET='--build-${{ inputs.target }}'" >> $GITHUB_ENV
# If there's no dependencies cache, fetch sources, with or without debug
- run: CACHE_API_EXEC=yes ./bin/spc fetch --with-php=${{ inputs.version }} --all ${{ env.SPC_BUILD_DEBUG }}
# Run build command
- run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_TARGET }}