mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-14 15:35:31 +00:00
Version PHP build caches by image version
we can't safely use `ubuntu-latest` because the build caches will break if they were built for 18.04 and used on 20.04, or vice versa. Instead, we pin the images (and caches) to a specific version.
This commit is contained in:
parent
4771e3dc28
commit
96181f8cf5
20
.github/workflows/main.yml
vendored
20
.github/workflows/main.yml
vendored
@ -8,10 +8,11 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-php:
|
build-php:
|
||||||
name: Prepare PHP
|
name: Prepare PHP
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.image }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
image: [ubuntu-20.04]
|
||||||
php: [7.3.25, 7.4.13]
|
php: [7.3.25, 7.4.13]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -21,7 +22,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "./bin"
|
path: "./bin"
|
||||||
key: "php-build-generic-${{ matrix.php }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||||
|
|
||||||
- name: Compile PHP
|
- name: Compile PHP
|
||||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||||
@ -30,11 +31,12 @@ jobs:
|
|||||||
phpstan:
|
phpstan:
|
||||||
name: PHPStan analysis
|
name: PHPStan analysis
|
||||||
needs: build-php
|
needs: build-php
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.image }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
image: [ubuntu-20.04]
|
||||||
php: [7.3.25, 7.4.13]
|
php: [7.3.25, 7.4.13]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -45,7 +47,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "./bin"
|
path: "./bin"
|
||||||
key: "php-build-generic-${{ matrix.php }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||||
|
|
||||||
- name: Kill build on PHP build cache miss (should never happen)
|
- name: Kill build on PHP build cache miss (should never happen)
|
||||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||||
@ -76,10 +78,11 @@ jobs:
|
|||||||
phpunit:
|
phpunit:
|
||||||
name: PHPUnit tests
|
name: PHPUnit tests
|
||||||
needs: build-php
|
needs: build-php
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.image }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
image: [ubuntu-20.04]
|
||||||
php: [7.3.25, 7.4.13]
|
php: [7.3.25, 7.4.13]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -90,7 +93,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "./bin"
|
path: "./bin"
|
||||||
key: "php-build-generic-${{ matrix.php }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||||
|
|
||||||
- name: Kill build on PHP build cache miss (should never happen)
|
- name: Kill build on PHP build cache miss (should never happen)
|
||||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||||
@ -121,10 +124,11 @@ jobs:
|
|||||||
integration:
|
integration:
|
||||||
name: Integration tests
|
name: Integration tests
|
||||||
needs: build-php
|
needs: build-php
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.image }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
image: [ubuntu-20.04]
|
||||||
php: [7.3.25, 7.4.13]
|
php: [7.3.25, 7.4.13]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -137,7 +141,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "./bin"
|
path: "./bin"
|
||||||
key: "php-build-generic-${{ matrix.php }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||||
|
|
||||||
- name: Kill build on PHP build cache miss (should never happen)
|
- name: Kill build on PHP build cache miss (should never happen)
|
||||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user