Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilise Lighthouse line numbers #123

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/audits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ jobs:
workspace:
- deno
- hotchocolate
- lighthouse
- postgraphile
# TODO: speed up build process
# - pioneer
# TODO: ensure consistant results
# - lighthouse
env:
PORT: 4000
steps:
Expand All @@ -96,7 +95,7 @@ jobs:
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
- name: Start
run: yarn workspace ${{ matrix.workspace }} start --detach --wait
run: yarn workspace ${{ matrix.workspace }} start --wait
spawnia marked this conversation as resolved.
Show resolved Hide resolved
- name: Audit
run: yarn tsx scripts/audit-implementation.ts implementations/${{ matrix.workspace }}
- name: Summary
Expand Down
22 changes: 18 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,36 @@ Every implementation is expected to contain a `package.json` file with at least
"name": "implementation-name", // should be equivalent to the directory name
"url": "https://implementation-name.example", // the official project URL
"scripts": {
"start": "node ." | "docker-compose up -d" // depending if the server can be run through node or Docker
"start": "node ." | "docker compose up" // depending if the server can be run through Node.js or Docker
}
}
```

Depending on how your server is run, add it to the appropriate section of [.github/workflows/audits.yml](.github/workflows/audits.yml):

- `node .`: `jobs.javascript.strategy.matrix.workspace`
- `docker-compose up -d`: `jobs.docker.strategy.matrix.workspace`
- Node.js: `jobs.javascript.strategy.matrix.workspace`
- Docker: `jobs.docker.strategy.matrix.workspace`

The script run in `start` is expected to bring up an HTTP server that listens to the port defined in the environment variable `$PORT`.

After adding your directory and `package.json`, run `yarn install` to include the workspace.

You may run the audit on your implementation locally by first bringing up the server:

```shell
PORT=4000 yarn workspace <implementation> start
enisdenjo marked this conversation as resolved.
Show resolved Hide resolved
```

Then open another shell or move the prior process to the background and run:

```shell
PORT=4000 yarn tsx scripts/audit-implementation.ts implementations/<implementation>
```

## Code formatting

Run the following script to ensure the automatic code formatting is applied:

yarn run lint:fix
```shell
yarn run lint:fix
```
22 changes: 15 additions & 7 deletions implementations/lighthouse/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
FROM php:8.1.21-cli

WORKDIR /app
FROM php:8.2.19-cli

# See https://getcomposer.org.
COPY --from=composer /usr/bin/composer /usr/bin/composer

RUN apt-get update && \
apt-get install --yes \
# Required to make the composer installations work.
RUN apt-get update \
&& apt-get install --yes \
git \
libzip-dev \
zip \
&& docker-php-ext-install \
zip \
&& rm -rf /var/lib/apt/lists/*
RUN composer create-project laravel/laravel /app
RUN composer require nuwave/lighthouse 6.14.0

# Creating a project following https://laravel.com/docs/installation#creating-a-laravel-project.
# See https://github.com/laravel/laravel/releases for new versions.
WORKDIR /app
RUN composer create-project laravel/laravel=11.1.1 /app

enisdenjo marked this conversation as resolved.
Show resolved Hide resolved
# See https://github.com/nuwave/lighthouse/releases for new versions.
RUN composer require nuwave/lighthouse:6.36.3

# Following https://lighthouse-php.com/6/getting-started/installation.html#publish-the-default-schema.
RUN php artisan vendor:publish --tag=lighthouse-schema
Loading
Loading