diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a26c8a80..da36612c9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,26 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" + build-php: + name: Prepare PHP + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 #needed for build.sh + - name: Check for PHP build cache + id: php-build-cache + uses: actions/cache@v2 + with: + path: "./bin" + key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}" + + - name: Compile PHP + if: steps.php-build-cache.outputs.cache-hit != 'true' + run: ./tests/gh-actions/build.sh + build: + name: Tests + needs: build-php # The type of runner that the job will run on runs-on: ubuntu-latest @@ -26,9 +45,9 @@ jobs: path: "./bin" key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}" - - name: Compile PHP + - name: Check PHP build cache restored successfully if: steps.php-build-cache.outputs.cache-hit != 'true' - run: ./tests/gh-actions/build.sh + run: exit 1 - name: Prefix PHP to PATH run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH @@ -40,9 +59,11 @@ jobs: uses: actions/cache@v2 with: path: | - ~/.composer/cache/files - ~/.composer/cache/vcs - key: composer-cache + ~/.cache/composer/files + ~/.cache/composer/vcs + key: "composer-v2-cache-${{ hashFiles('./composer.lock') }}" + restore-keys: | + composer-v2-cache- - name: Install Composer dependencies run: php composer.phar install --prefer-dist --no-interaction diff --git a/tests/gh-actions/build.sh b/tests/gh-actions/build.sh index 27593ac4b..6215b6d32 100755 --- a/tests/gh-actions/build.sh +++ b/tests/gh-actions/build.sh @@ -89,30 +89,31 @@ CXXFLAGS="$CXXFLAGS -march=x86-64" --enable-cli \ --disable-cgi \ --disable-phpdbg \ - --disable-session \ - --without-pear \ - --without-sqlite3 \ - --disable-pdo \ - --enable-pthreads \ - --with-yaml \ - --with-libxml \ - --enable-xml \ - --enable-simplexml \ - --enable-xmlreader \ - --enable-xmlwriter \ - --enable-mbstring \ --disable-mbregex \ - --enable-sockets \ - --with-curl \ - --with-zlib \ - --with-zip \ - --with-gmp \ - --with-openssl \ - --with-leveldb="$INSTALL_DIR" \ - --enable-igbinary \ - --enable-morton \ + --disable-pdo \ + --disable-session \ --enable-chunkutils2 \ --enable-ds \ + --enable-igbinary \ + --enable-mbstring \ + --enable-morton \ + --enable-pthreads \ + --enable-simplexml \ + --enable-sockets \ + --enable-xml \ + --enable-xmlreader \ + --enable-xmlwriter \ --with-crypto \ + --with-curl \ + --with-gmp \ + --with-leveldb="$INSTALL_DIR" \ + --with-libxml \ + --with-openssl \ + --with-openssl \ + --with-yaml \ + --with-zip \ + --with-zlib \ + --without-pear \ + --without-sqlite3 make -j8 install