ci: revise build config

This commit is contained in:
naskya 2024-05-06 23:40:52 +09:00
parent 0c4826becf
commit 7fe7f90350
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
2 changed files with 23 additions and 10 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,26 +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
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"]