-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (69 loc) · 2.64 KB
/
composer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# This is a basic workflow to help you get started with Actions
name: "check composer"
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- "**"
pull_request:
branches:
- main
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "30 */6 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v4.1.1"
with:
ref: "${{ github.head_ref }}"
token: ${{ secrets.GITHUB_TOKEN }}
- name: "Validate composer files"
run: "composer validate --strict"
normalize:
needs:
- validate
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.0"
dependencies:
- "locked"
steps:
- name: "Checkout"
uses: "actions/checkout@v4.1.1"
with:
ref: "${{ github.head_ref }}"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Commit Message
run: |
echo "##[set-output name=message;][${GITHUB_REF#refs/heads/}] normalize composer files"
id: generate_commit_message
- name: "Determine composer cache directory"
uses: "./.github/.helper/composer/determine_cache_directory"
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v4.0.0"
with:
path: "${{ env.COMPOSER_CACHE_DIR }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "./.github/.helper/composer/install"
with:
dependencies: "${{ matrix.dependencies }}"
- name: "normalize composer.json"
run: |
composer normalize
- uses: stefanzweifel/git-auto-commit-action@v5.0.0
with:
commit_message: ${{ steps.generate_commit_message.outputs.message }}
commit_user_name: 🤖 Wayfapper-Bot 🤖 # defaults to "GitHub Actions"
commit_user_email: 83136706+wayfapper-bot@users.noreply.github.com # defaults to "actions@github.com"
commit_author: 🤖 Wayfapper-Bot 🤖 <83136706+wayfapper-bot@users.noreply.github.com> # defaults to author of the commit that triggered the run