From 7fe7f9035083f20f71c3de6438c865d568433484 Mon Sep 17 00:00:00 2001 From: naskya Date: Mon, 6 May 2024 23:40:52 +0900 Subject: [PATCH] ci: revise build config --- .gitlab-ci.yml | 30 ++++++++++++++++++++---------- ci/cargo/config.toml | 3 +++ 2 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 ci/cargo/config.toml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4dab0f7531..6261f9af0e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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' diff --git a/ci/cargo/config.toml b/ci/cargo/config.toml new file mode 100644 index 0000000000..b0de924994 --- /dev/null +++ b/ci/cargo/config.toml @@ -0,0 +1,3 @@ +[target.x86_64-unknown-linux-gnu] +linker = "/usr/bin/clang" +rustflags = ["-C", "link-arg=--ld-path=/usr/bin/mold"]