diff --git a/.github/workflows/_matrix.json b/.github/workflows/_matrix.json new file mode 100644 index 00000000..9c0b28e7 --- /dev/null +++ b/.github/workflows/_matrix.json @@ -0,0 +1,28 @@ +{ + "pr": { + "ci": { + "include": [ + { + "php": "8.0", + "sylius": "1.12.*", + "symfony": "5.4.*", + "mysql": "8.0" + }, + { + "php": "8.3", + "sylius": "1.13.*", + "symfony": "6.4.*", + "mysql": "8.0" + } + ] + } + }, + "daily": { + "ci": { + "php": ["8.0", "8.3"], + "sylius": ["1.12.*", "1.13.*"], + "symfony": ["5.4.*", "6.4.*"], + "mysql": ["8.0"] + } + } +} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0a004cf9..19f8f9df 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,13 +1,29 @@ name: Continuous Integration on: - push: ~ - pull_request: ~ - release: - types: [created] workflow_dispatch: ~ + workflow_call: + inputs: + type: + description: "Type of the build" + required: true + type: string jobs: + get-matrix: + runs-on: ubuntu-latest + name: "Get matrix" + outputs: + matrix: ${{ steps.matrix.outputs.prop }} + steps: + - + name: "Get matrix" + id: matrix + uses: notiz-dev/github-action-json-property@release + with: + path: '.github/workflows/_matrix.json' + prop_path: '${{ inputs.type }}.ci' + tests: runs-on: ubuntu-latest @@ -15,12 +31,7 @@ jobs: strategy: fail-fast: false - matrix: - php: ["8.0", "8.1"] - symfony: ["5.4.*", "^6.0"] - sylius: ["^1.12"] - node: ["16.x"] - mysql: ["5.7", "8.0"] + matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }} env: APP_ENV: test @@ -36,18 +47,8 @@ jobs: build_type: "plugin" cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}" cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}" - e2e: "yes" - e2e_js: "yes" database_version: ${{ matrix.mysql }} php_version: ${{ matrix.php }} symfony_version: ${{ matrix.symfony }} - - - - name: Upload logs - uses: actions/upload-artifact@v3 - if: failure() - with: - name: Logs - path: | - var/log/ - if-no-files-found: ignore + sylius_version: ${{ matrix.sylius }} + e2e_js: true diff --git a/.github/workflows/ci__daily.yaml b/.github/workflows/ci__daily.yaml new file mode 100644 index 00000000..0c108892 --- /dev/null +++ b/.github/workflows/ci__daily.yaml @@ -0,0 +1,18 @@ +name: Continuous Integration (Daily) + +on: + schedule: + - + cron: "0 3 * * *" # Run every day at 3am + workflow_dispatch: ~ + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }}-minimal + cancel-in-progress: true + +jobs: + ci: + name: CI + uses: ./.github/workflows/ci.yaml + with: + type: "daily" diff --git a/.github/workflows/ci__pr.yaml b/.github/workflows/ci__pr.yaml new file mode 100644 index 00000000..f5b65eb5 --- /dev/null +++ b/.github/workflows/ci__pr.yaml @@ -0,0 +1,22 @@ +name: Continuous Integration (PR) + +on: + pull_request: + paths-ignore: + - ".platform/**" + - "*.md" + push: + branches: + - main + workflow_dispatch: ~ + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }}-minimal + cancel-in-progress: true + +jobs: + ci: + name: CI + uses: ./.github/workflows/ci.yaml + with: + type: "pr"