Skip to content

Commit

Permalink
ci: smoke test with lando
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Jan 15, 2025
1 parent 5557d47 commit f666b52
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 23 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,18 @@ jobs:

smoke-test-example:
runs-on: ubuntu-latest
working-directory: example
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

- uses: lando/setup-lando@v3
with:
node-version: lts/*
- run: npm ci
- run: docker compose up -d
working-directory: example
- run: npm run start:prod > api.log &
env:
log: trace
working-directory: example
- name: Wait for server to start
run: npx wait-on http://localhost:1429/plaque/newton-s-apple-tree-monash-university -t 30s
- run: npx wait-on http://localhost:1429/plaque/newton-s-apple-tree-monash-university.html -t 1s
- uses: actions/upload-artifact@v4
if: always()
lando-version: 3.21.2
- uses: tpluscode/[email protected]
with:
name: api log
path: example/api.log
healthcheck: http://db.read-the-plaque.lndo.site/
timeout: 30000
ignore-errors: true

- run: curl https://read-the-plaque.lndo.site/plaque/newton-s-apple-tree-monash-university -If
- run: curl https://read-the-plaque.lndo.site/plaque/newton-s-apple-tree-monash-university.html -If
34 changes: 34 additions & 0 deletions .lando.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: read-the-plaque
services:
oxigraph:
api: 3
type: lando
entrypoint: /usr/local/bin/oxigraph
app_mount: false
scanner: false
ssl: true
services:
image: ghcr.io/oxigraph/oxigraph:0.4.6
user: root
command: serve --location /data --bind 0.0.0.0:7878
ports:
- 7878
volumes:
- ./example/oxigraph:/data
app:
type: node:20
ssl: true
scanner: false
build:
- npm i
command: cd example; kopflos serve --mode development --trust-proxy
overrides:
environment:
API_BASE: https://read-the-plaque.lndo.site
DB_URI: http://db.read-the-plaque.lndo.site

proxy:
oxigraph:
- db.read-the-plaque.lndo.site:7878
app:
- read-the-plaque.lndo.site:1429
2 changes: 1 addition & 1 deletion example/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
oxigraph:
image: ghcr.io/oxigraph/oxigraph:0.4.4
image: ghcr.io/oxigraph/oxigraph:0.4.6
user: root
command: serve --location /data --bind 0.0.0.0:7878
ports:
Expand Down
15 changes: 9 additions & 6 deletions example/kopflos.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import * as url from 'node:url'
import type { KopflosConfig } from '@kopflos-cms/core'

const baseIri = process.env.API_BASE || 'http://localhost:1429'
const dbUri = process.env.DB_URI || 'http://localhost:7878'

export default <KopflosConfig> {
baseIri: 'http://localhost:1429',
apiGraphs: ['http://localhost:1429/api'],
baseIri,
apiGraphs: [baseIri + '/api'],
sparql: {
default: {
endpointUrl: 'http://localhost:7878/query?union-default-graph',
updateUrl: 'http://localhost:7878/update',
storeUrl: 'http://localhost:7878/store',
endpointUrl: dbUri + '/query?union-default-graph',
updateUrl: dbUri + '/update',
storeUrl: dbUri + '/store',
},
},
watch: ['lib'],
Expand All @@ -28,7 +31,7 @@ export default <KopflosConfig> {
entrypoints: ['ui/*.html'],
},
'@kopflos-cms/hydra': {
apis: ['http://localhost:1429/api'],
apis: [baseIri + '/api'],
},
},
}

0 comments on commit f666b52

Please sign in to comment.