Skip to content

Commit

Permalink
Add a configured CI split into PR/daily
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubtobiasz committed Sep 5, 2024
1 parent 2c94cea commit b6fc11d
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 22 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/_matrix.json
Original file line number Diff line number Diff line change
@@ -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"]
}
}
}
45 changes: 23 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
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

name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}"

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
Expand All @@ -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
18 changes: 18 additions & 0 deletions .github/workflows/ci__daily.yaml
Original file line number Diff line number Diff line change
@@ -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"
22 changes: 22 additions & 0 deletions .github/workflows/ci__pr.yaml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit b6fc11d

Please sign in to comment.