-
Notifications
You must be signed in to change notification settings - Fork 6
73 lines (62 loc) · 2.22 KB
/
on-push-to-main.yaml
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
name: On push to main
on:
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-24.04
env:
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: grpc, protobuf
tools: composer
- name: Install dependencies
run: composer install
- name: Check CS
run: php vendor/bin/php-cs-fixer fix --diff --dry-run --show-progress=none
- name: Run tests
run: php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml
- name: Run examples
env:
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
working-directory: ./examples
run: |
composer install
php ./example.php
php ./dictionary-example.php
php ./list-example.php
php ./set-example.php
php ./doc-examples-php-apis.php
php ./storage-example.php
php ./psr16-example.php
- name: Generate README
uses: momentohq/standards-and-practices/github-actions/generate-and-commit-oss-readme@gh-actions-v2
with:
project_status: official
project_stability: stable
project_type: sdk
sdk_language: PHP
dev_docs_slug: php
template_file: ./README.template.md
output_file: ./README.md
- uses: google-github-actions/release-please-action@v3
name: Release Please
id: release
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
release-type: php
package-name: momentohq/client-sdk-php
extra-files: |
src/Cache/Interceptors/AgentInterceptor.php
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'
- name: Publish
run: |
echo "Published version: ${{ steps.release.outputs.tag_name }}"
if: ${{ steps.release.outputs.release_created }}