Compare commits

...

4 Commits

4 changed files with 39 additions and 14 deletions

View File

@ -1,4 +1,4 @@
image: docker.io/node:18-alpine
image: docker.io/rust:slim-bookworm
services:
- name: docker.io/groonga/pgroonga:latest-alpine-12-slim
@ -15,27 +15,36 @@ workflow:
cache:
paths:
- node_modules/
- target/
- node_modules
- /cache/cargo/registry/index
- /cache/cargo/registry/cache
- target/debug/deps
- target/debug/build
stages:
- test
variables:
POSTGRES_DB: firefish_db
POSTGRES_USER: firefish
POSTGRES_PASSWORD: password
POSTGRES_HOST_AUTH_METHOD: trust
GIT_CLEAN_FLAGS: -ffdx --exclude node_modules/ --exclude target/
POSTGRES_DB: 'firefish_db'
POSTGRES_USER: 'firefish'
POSTGRES_PASSWORD: 'password'
POSTGRES_HOST_AUTH_METHOD: 'trust'
DEBIAN_FRONTEND: 'noninteractive'
CARGO_PROFILE_DEV_OPT_LEVEL: '0'
CARGO_PROFILE_DEV_LTO: 'off'
CARGO_PROFILE_DEV_DEBUG: 'none'
CARGO_HOME: '/cache/cargo'
default:
before_script:
- apk add --update build-base linux-headers curl ca-certificates python3 perl postgresql-client
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- . "${HOME}/.cargo/env"
- apt-get -y install curl
- curl -fsSL 'https://deb.nodesource.com/setup_18.x' | sudo -E bash -
- apt-get update && apt-get upgrade
- apt-get install -y build-essential clang mold python3 perl nodejs postgresql-client
- corepack enable
- corepack prepare pnpm@latest --activate
- cp .config/ci.yml .config/default.yml
- cp ci/cargo/config.toml "${CARGO_HOME}/config.toml"
- export PGPASSWORD="${POSTGRES_PASSWORD}"
- psql --host postgres --user "${POSTGRES_USER}" --dbname "${POSTGRES_DB}" --command 'CREATE EXTENSION pgroonga'

3
ci/cargo/config.toml Normal file
View File

@ -0,0 +1,3 @@
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang"
rustflags = ["-C", "link-arg=--ld-path=/usr/bin/mold"]

View File

@ -1,6 +1,4 @@
import { noteVisibilities } from "firefish-js";
import type { NoteVisibility } from "@/types/note";
export const noteVisibilitiesClient = (
noteVisibilities as readonly NoteVisibility[]
).concat("private");
export const noteVisibilitiesClient = (noteVisibilities as readonly NoteVisibility[]).concat("private");

View File

@ -1,6 +1,7 @@
import path, { join } from "node:path";
import { fileURLToPath } from "node:url";
import { execa } from "execa";
import fs from "node:fs";
(async () => {
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@ -32,4 +33,18 @@ import { execa } from "execa";
stdio: "inherit",
}
);
if (!fs.existsSync(join(__dirname, "/../packages/backend-rs/built/index.js"))) {
fs.copyFileSync(
join(__dirname, "/../packages/backend-rs/index.js"),
join(__dirname, "/../packages/backend-rs/built/index.js"),
);
console.warn("backend-rs/built/index.js has not been updated (https://github.com/napi-rs/napi-rs/issues/1768)");
}
if (!fs.existsSync(join(__dirname, "/../packages/backend-rs/built/index.d.ts"))) {
fs.copyFileSync(
join(__dirname, "/../packages/backend-rs/index.d.ts"),
join(__dirname, "/../packages/backend-rs/built/index.d.ts"),
);
}
})();