chore: use memory sqlite on CI #239
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: [push, pull_request] | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v2 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
- run: docker network create traefik | |
- name: Run setup Docker container | |
# Use memory sqlite on CI as file-based doesn't work due to wonky GitHub Action permissions | |
run: | | |
cd src | |
cp .env-example .env | |
sed -i 's/DB_DATABASE=/var/www/html/storage/database.sqlite/DB_DATABASE=:memory:/g' .env | |
just setup | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v2 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- name: Lint project | |
run: | | |
cd src | |
just install lint | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v2 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
coverage: xdebug | |
- run: docker network create traefik | |
- name: Run coverage report | |
# Use memory sqlite on CI as file-based doesn't work due to wonky GitHub Action permissions | |
run: | | |
cd src | |
cp .env-example .env | |
sed -i 's/DB_DATABASE=/var/www/html/storage/database.sqlite/DB_DATABASE=:memory:/g' .env | |
just setup coverage | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
needs: ['docker', 'lint', 'test'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to Harvey | |
uses: distributhor/workflow-webhook@v2 | |
env: | |
webhook_type: 'json-extended' | |
webhook_url: ${{ secrets.WEBHOOK_URL }} | |
webhook_secret: ${{ secrets.WEBHOOK_SECRET }} | |
data: '{ "deployment_type": "deploy", "prod_compose": true, "healthcheck": ["justinpaulhammond-justinpaulhammond-1", "justinpaulhammond-justinpaulhammond-2"] }' |