|
14 | 14 | jobs: |
15 | 15 | Test: |
16 | 16 | runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + # Note: Numbers should be quoted, especially if they're a .0 release because they'll be formatted as an int. |
| 21 | + phpversion: ["8.0", "8.1", "8.2"] |
| 22 | + osversion: [buster, bullseye] |
17 | 23 | steps: |
18 | 24 | - name: Checkout |
19 | 25 | uses: actions/checkout@v3 |
20 | 26 |
|
21 | 27 | - name: Build image |
22 | 28 | run: | |
23 | | - docker build . -t moodle-php-apache |
| 29 | + docker build ${{matrix.phpversion}}/${{matrix.osversion}} -t moodle-php-apache |
24 | 30 |
|
25 | 31 | - name: Run tests |
26 | 32 | run: | |
27 | 33 | docker run --name test0 -d -p 8000:80 \ |
28 | | - -v $PWD/tests/fixtures:/var/www/html \ |
29 | | - -v $PWD/tests/docker-entrypoint.d:/docker-entrypoint.d \ |
| 34 | + -v $PWD/${{matrix.phpversion}}/${{matrix.osversion}}/tests/fixtures:/var/www/html \ |
| 35 | + -v $PWD/${{matrix.phpversion}}/${{matrix.osversion}}/tests/docker-entrypoint.d:/docker-entrypoint.d \ |
30 | 36 | moodle-php-apache |
31 | 37 | docker exec test0 php /var/www/html/test.php |
32 | 38 | docker exec test0 php /var/www/html/check-ini.php |
|
49 | 55 | # Requires Test to pass |
50 | 56 | needs: Test |
51 | 57 | runs-on: ubuntu-latest |
| 58 | + strategy: |
| 59 | + fail-fast: false |
| 60 | + matrix: |
| 61 | + # This matrix must match the matrix defined in the Test. |
| 62 | + # Note: Numbers should be quoted, especially if they're a .0 release because they'll be formatted as an int. |
| 63 | + phpversion: ["8.0", "8.1", "8.2"] |
| 64 | + osversion: [buster, bullseye] |
52 | 65 | steps: |
53 | 66 | - name: Checkout |
54 | 67 | uses: actions/checkout@v3 |
|
93 | 106 | - name: Build and publish to Docker Hub and Github registries |
94 | 107 | uses: docker/build-push-action@v3 |
95 | 108 | with: |
96 | | - context: . |
| 109 | + context: ${{matrix.phpversion}}/${{matrix.osversion}} |
97 | 110 | file: Dockerfile |
98 | 111 | platforms: linux/amd64,linux/arm64 |
99 | 112 | push: true |
|
0 commit comments