Skip to content

auto-cache-pool-tarball #7

auto-cache-pool-tarball

auto-cache-pool-tarball #7

name: auto-cache-pool-tarball
on:
push:
pull_request:
schedule:
- cron: '0 0 */6 * *'
jobs:
auto-cache-pool:
if: 1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare Source Code
run: |
echo $PATH
env
docker info
id -u
id -g
who
cat /etc/os-release
hostnamectl
uname -s
uname -m
uname -r
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
cat /proc/cpuinfo | grep "cpu cores" | uniq
cat /proc/cpuinfo| grep "processor"| wc -l
lscpu
export IPV6=$(ip -6 address show | grep inet6 | awk '{print $2}' | cut -d'/' -f1 | sed -n '2p')
export IPV4=$(ip -4 address show | grep inet | grep -v 127.0.0 | awk '{print $2}' | cut -d'/' -f1 | sed -n '1p')
echo $IPV4
echo $IPV6
echo "X_IPV6=${IPV6}" >> $GITHUB_ENV
echo "X_IPV4=${IPV4}" >> $GITHUB_ENV
- name: Cache PHP Runtime
uses: actions/cache@v4
id: php-runtime-cache
with:
path: ${{ github.workspace }}/bin/runtime
key: ${{ runner.os }}-x86_64-php-runtime
- name: Cache PHP Vendor
uses: actions/cache@v4
id: php-vendor-cache
with:
path: ${{ github.workspace }}/vendor
key: ${{ runner.os }}-x86_64-php-vendor
- name: Cache Dependency Source Code Tarball
uses: actions/cache@v4
id: pool-cache
with:
path: ${{ github.workspace }}/pool/
key: source-code-tarball-pool
- name: Prepare Runtime and Libraries and Extensions
run: |
set -x
mkdir -p pool/lib
mkdir -p pool/ext
mkdir -p bin/runtime
if [ ! -f bin/runtime/php ] ; then
bash setup-php-runtime.sh
fi
ls -A pool/lib/
WORK_DIR=${{ github.workspace }}
uname -m
export PATH=${WORK_DIR}/bin/runtime:$PATH
alias php="php -d curl.cainfo=${WORK_DIR}/bin/runtime/cacert.pem -d openssl.cafile=${WORK_DIR}/bin/runtime/cacert.pem"
composer install --no-interaction --no-autoloader --no-scripts --profile
composer dump-autoload --optimize --profile
php prepare.php +inotify +apcu +ds +xlswriter +ssh2 +pgsql --show-tarball-hash=1
php prepare.php +apcu +ds +xlswriter +ssh2 +pgsql @macos --show-tarball-hash=1
cd ${{ github.workspace }}/pool/
zip -9 -r ${WORK_DIR}/all-deps.zip ext lib
HASH=$(sha256sum ${WORK_DIR}/all-deps.zip | awk '{print $1}')
echo " all-deps.zip sha265: ${HASH} "
echo -n ${HASH} > ${WORK_DIR}/all-deps.zip.sha256sum
cd ${{ github.workspace }}
- name: Show Build Result
run: |
ls -A pool/lib/
ls -A pool/ext/
- name: production artifacts
if: 1
uses: actions/upload-artifact@v4
with:
name: all-deps
retention-days: 90
path: |
all-deps.zip
all-deps.zip.sha256sum
- name: gh release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
all-deps.zip
all-deps.zip.sha256sum