Repository navigation
55 lines (55 loc) · 2.05 KB
/
Copy pathci.yml
File metadata and controls
55 lines (55 loc) · 2.05 KB
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
name: Verify
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
verify:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: onto-ci-test-only-7v93
POSTGRES_DB: onto_test
ports: ['5432:5432']
options: >-
--health-cmd pg_isready --health-interval 5s
--health-timeout 5s --health-retries 10
env:
DATABASE_URL: postgresql://postgres:onto-ci-test-only-7v93@127.0.0.1:5432/onto_test
TEST_PROJECT_DATABASE_URL: postgresql://postgres:onto-ci-test-only-7v93@127.0.0.1:5432/onto_project_test
DATA_SECRET_FILE: /tmp/onto-ci/database.key
DOCUMENT_FILES_DIR: /tmp/onto-ci/media
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Prepare isolated test database
run: |
cp .env.example .env
node --input-type=module -e 'import pg from "pg"; const c = new pg.Client({connectionString: process.env.DATABASE_URL}); await c.connect(); await c.query("CREATE DATABASE onto_project_test"); await c.end();'
- run: pnpm build
- run: pnpm test
- name: Package with a temporary test signature
env:
IPOLLOWORK_PLUGIN_SIGNING_KEY: ${{ runner.temp }}/onto-ci-signing.pem
IPOLLOWORK_PLUGIN_KEY_ID: ci-test-only
run: |
node --input-type=module <<'NODE'
import { generateKeyPairSync } from 'node:crypto';
import { writeFileSync } from 'node:fs';
const { privateKey } = generateKeyPairSync('ed25519');
writeFileSync(process.env.IPOLLOWORK_PLUGIN_SIGNING_KEY,
privateKey.export({ format: 'pem', type: 'pkcs8' }), { mode: 0o600 });
NODE
pnpm package:plugin
# This test artifact is not published or trusted by the desktop host.
- run: pnpm test:plugin