-
Notifications
You must be signed in to change notification settings - Fork 9
54 lines (47 loc) · 1.69 KB
/
lighthouse-php.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
name: Lighthouse PHP
on:
push:
branches: ["main"]
paths:
- .github/workflows/*lighthouse*.yml
- api/**
pull_request:
paths:
- .github/workflows/*lighthouse*.yml
- api/**
merge_group:
branches: [main]
jobs:
lighthouse-php:
name: Lighthouse PHP
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "Build docker image: api"
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml up api --detach
- name: "Re-generate lighthouse schema"
run: |
docker compose exec --no-TTY api php artisan lighthouse:print-schema --write
docker compose cp api:/var/www/html/api/storage/app/lighthouse-schema.graphql ./api/storage/app/
- name: Check for uncommitted changes
id: check_changes
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Error if changes
if: steps.check_changes.outputs.changed != 0
# See: https://github.com/actions/github-script
uses: actions/github-script@v7
with:
script: |
core.setFailed('Please update api/storage/app/lighthouse-schema.graphql')
# Allows SSH access into CI environment for up to 1h.
# Use `touch ~/continue` with session to end each one.
# Only enable when trying to troubleshoot.
#
# Note: Be cautious, as secrets in environment can be compromised.
# Consider using in PRs from forks, without secrets available.
#
# See: https://github.com/lhotari/action-upterm
- name: Create upterm session for debug
uses: lhotari/action-upterm@v1
if: ${{ false }}
# if: ${{ always() }}