Skip to content

Commit

Permalink
testing matrix composition
Browse files Browse the repository at this point in the history
  • Loading branch information
intuibase committed Jun 27, 2024
1 parent aa8dfa7 commit 9708c61
Showing 1 changed file with 69 additions and 70 deletions.
139 changes: 69 additions & 70 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build:
uses: ./.github/workflows/build.yml
with:
build_arch: all
# build:
# uses: ./.github/workflows/build.yml
# with:
# build_arch: all

setup-build-matrix:
uses: ./.github/workflows/build-arch-matrix-generator.yml
Expand All @@ -51,9 +51,8 @@ jobs:
fail-fast: false
matrix:
php-version: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]
# include: ${{ fromJson('{"include":[{"arch":"linux-x86-64"},{"arch":"linuxmusl-x86-64"},{"arch":"linux-arm64","run_qemu":1},{"arch":"linuxmusl-arm64","run_qemu":1}]}').include }}
include: ${{ fromJson(needs.setup-build-matrix.outputs.matrix-combinations).include.map(n) => (arch: n.arch) }}
include: ${{ fromJson(needs.setup-build-matrix.outputs.matrix-combinations).include.map(n) => (run_qemu: n.run_qemu) }}
include: ${{ fromJson(needs.setup-build-matrix.outputs.matrix-combinations).include.map(n) => (arch: n.arch) }}
include: ${{ fromJson(needs.setup-build-matrix.outputs.matrix-combinations).include.map(n) => (run_qemu: n.run_qemu) }}
env:
PHP_VERSION: ${{ matrix.php-version }}
BUILD_ARCHITECTURE: ${{ matrix.arch }}
Expand Down Expand Up @@ -84,71 +83,71 @@ jobs:
# tree agent/native/_build/
# uname -a
# make -f .ci/Makefile run-phpt-tests
static-checks-unit-tests:
name: static-checks-unit-tests
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
dockerfile:
- "Dockerfile"
- "Dockerfile.alpine"
env:
PHP_VERSION: ${{ matrix.php-version }}
DOCKERFILE: ${{ matrix.dockerfile }}
steps:
- uses: actions/checkout@v4
- name: Prepare
run: make -f .ci/Makefile prepare
- name: Static Check / Unit tests
run: make -f .ci/Makefile static-check-unit-test
- if: success() || failure()
name: Prepare Upload
run: >-
find build
-name "*junit.xml"
-exec bash -c 'mv {} "build/${PHP_VERSION}-${DOCKERFILE}-$(basename {})"'
\;
- if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-results
path: build/*junit.xml
if-no-files-found: error
build-packages:
permissions:
contents: read
packages: read
needs:
- build
- static-checks-unit-tests
- phpt-tests
uses: ./.github/workflows/build-packages.yml
secrets: inherit
# static-checks-unit-tests:
# name: static-checks-unit-tests
# runs-on: ubuntu-latest
# timeout-minutes: 30
# strategy:
# fail-fast: false
# matrix:
# php-version:
# - "7.2"
# - "7.3"
# - "7.4"
# - "8.0"
# - "8.1"
# - "8.2"
# - "8.3"
# dockerfile:
# - "Dockerfile"
# - "Dockerfile.alpine"
# env:
# PHP_VERSION: ${{ matrix.php-version }}
# DOCKERFILE: ${{ matrix.dockerfile }}
# steps:
# - uses: actions/checkout@v4
# - name: Prepare
# run: make -f .ci/Makefile prepare
# - name: Static Check / Unit tests
# run: make -f .ci/Makefile static-check-unit-test
# - if: success() || failure()
# name: Prepare Upload
# run: >-
# find build
# -name "*junit.xml"
# -exec bash -c 'mv {} "build/${PHP_VERSION}-${DOCKERFILE}-$(basename {})"'
# \;
# - if: success() || failure()
# uses: actions/upload-artifact@v3
# with:
# name: test-results
# path: build/*junit.xml
# if-no-files-found: error
# build-packages:
# permissions:
# contents: read
# packages: read
# needs:
# - build
# - static-checks-unit-tests
# - phpt-tests
# uses: ./.github/workflows/build-packages.yml
# secrets: inherit

generate-test-packages-matrix:
uses: ./.github/workflows/generate-matrix.yml
# generate-test-packages-matrix:
# uses: ./.github/workflows/generate-matrix.yml

test-packages:
permissions:
contents: read
packages: read
needs:
- build-packages
- generate-test-packages-matrix
uses: ./.github/workflows/test-packages.yml
with:
include: ${{ needs.generate-test-packages-matrix.outputs.include }}
secrets: inherit
# test-packages:
# permissions:
# contents: read
# packages: read
# needs:
# - build-packages
# - generate-test-packages-matrix
# uses: ./.github/workflows/test-packages.yml
# with:
# include: ${{ needs.generate-test-packages-matrix.outputs.include }}
# secrets: inherit

# The very last job to report whether the Workflow passed.
# This will act as the Branch Protection gatekeeper
Expand Down

0 comments on commit 9708c61

Please sign in to comment.