Skip to content

Commit 4503a1b

Browse files
authored
Merge pull request #34 from Innmind/reuse-workflows
Reuse GitHub Actions workflows
2 parents ea05f5e + 0e3ca5a commit 4503a1b

File tree

3 files changed

+13
-119
lines changed

3 files changed

+13
-119
lines changed

.github/workflows/ci.yml

+9-86
Original file line numberDiff line numberDiff line change
@@ -4,92 +4,15 @@ on: [push]
44

55
jobs:
66
blackbox:
7-
runs-on: ${{ matrix.os }}
8-
strategy:
9-
matrix:
10-
os: [ubuntu-latest, macOS-latest]
11-
php-version: ['8.2', '8.3']
12-
dependency-versions: ['lowest', 'highest']
13-
name: 'BlackBox'
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v4
17-
- name: Setup PHP
18-
uses: shivammathur/setup-php@v2
19-
with:
20-
php-version: ${{ matrix.php-version }}
21-
extensions: mbstring, intl
22-
coverage: none
23-
- name: Composer
24-
uses: "ramsey/composer-install@v3"
25-
with:
26-
dependency-versions: ${{ matrix.dependencies }}
27-
- name: BlackBox
28-
run: php blackbox.php
29-
env:
30-
BLACKBOX_SET_SIZE: 20
7+
uses: innmind/github-workflows/.github/workflows/black-box-matrix.yml@main
8+
with:
9+
scenarii: 20
3110
coverage:
32-
runs-on: ${{ matrix.os }}
33-
strategy:
34-
matrix:
35-
os: [ubuntu-latest, macOS-latest]
36-
php-version: ['8.2', '8.3']
37-
dependency-versions: ['lowest', 'highest']
38-
name: 'Coverage'
39-
steps:
40-
- name: Checkout
41-
uses: actions/checkout@v4
42-
- name: Setup PHP
43-
uses: shivammathur/setup-php@v2
44-
with:
45-
php-version: ${{ matrix.php-version }}
46-
extensions: mbstring, intl
47-
coverage: xdebug
48-
- name: Composer
49-
uses: "ramsey/composer-install@v3"
50-
with:
51-
dependency-versions: ${{ matrix.dependencies }}
52-
- name: BlackBox
53-
run: php blackbox.php
54-
env:
55-
ENABLE_COVERAGE: 'true'
56-
BLACKBOX_SET_SIZE: 1
57-
- uses: codecov/codecov-action@v4
58-
with:
59-
token: ${{ secrets.CODECOV_TOKEN }}
11+
uses: innmind/github-workflows/.github/workflows/coverage-matrix.yml@main
12+
secrets: inherit
6013
psalm:
61-
runs-on: ubuntu-latest
62-
strategy:
63-
matrix:
64-
php-version: ['8.2', '8.3']
65-
name: 'Psalm'
66-
steps:
67-
- name: Checkout
68-
uses: actions/checkout@v4
69-
- name: Setup PHP
70-
uses: shivammathur/setup-php@v2
71-
with:
72-
php-version: ${{ matrix.php-version }}
73-
extensions: mbstring, intl
74-
- name: Composer
75-
uses: "ramsey/composer-install@v3"
76-
- name: Psalm
77-
run: vendor/bin/psalm --shepherd
14+
uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main
7815
cs:
79-
runs-on: ubuntu-latest
80-
strategy:
81-
matrix:
82-
php-version: ['8.2']
83-
name: 'CS'
84-
steps:
85-
- name: Checkout
86-
uses: actions/checkout@v4
87-
- name: Setup PHP
88-
uses: shivammathur/setup-php@v2
89-
with:
90-
php-version: ${{ matrix.php-version }}
91-
extensions: mbstring, intl
92-
- name: Composer
93-
uses: "ramsey/composer-install@v3"
94-
- name: CS
95-
run: vendor/bin/php-cs-fixer fix --diff --dry-run
16+
uses: innmind/github-workflows/.github/workflows/cs.yml@main
17+
with:
18+
php-version: '8.2'

.github/workflows/documentation.yml

+2-19
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,5 @@ permissions:
66
contents: write
77
jobs:
88
deploy:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v4
12-
- name: Configure Git Credentials
13-
run: |
14-
git config user.name github-actions[bot]
15-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
16-
- uses: actions/setup-python@v5
17-
with:
18-
python-version: 3.x
19-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
20-
- uses: actions/cache@v4
21-
with:
22-
key: mkdocs-material-${{ env.cache_id }}
23-
path: .cache
24-
restore-keys: |
25-
mkdocs-material-
26-
- run: pip install mkdocs-material
27-
- run: mkdocs gh-deploy --force
9+
uses: innmind/github-workflows/.github/workflows/documentation.yml@main
10+
secrets: inherit

.github/workflows/release.yml

+2-14
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,7 @@ on:
55
tags:
66
- '*'
77

8-
permissions:
9-
contents: write
10-
118
jobs:
129
release:
13-
name: Create release
14-
runs-on: ubuntu-22.04
15-
steps:
16-
- name: Create release
17-
env:
18-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
tag: ${{ github.ref_name }}
20-
run: |
21-
gh release create "$tag" \
22-
--repo="$GITHUB_REPOSITORY" \
23-
--generate-notes
10+
uses: innmind/github-workflows/.github/workflows/release.yml@main
11+
secrets: inherit

0 commit comments

Comments
 (0)