yama/.woodpecker/build.yml

52 lines
2.1 KiB
YAML

# must set build pipeline as .woodpecker/ with the trailing slash to activate the
# multiple pipelines
platform: linux/amd64
pipeline:
unitTests:
image: "rust:1.65.0"
pull: true
commands:
- DEBIAN_FRONTEND=noninteractive apt-get -qq update > /dev/null
- DEBIAN_FRONTEND=noninteractive apt-get -yqq install pkg-config libssl-dev build-essential libsqlite3-dev > /dev/null
- cargo build --all
- cargo test --all
when:
event: [push, pull_request]
testSuite:
image: "rust:1.65.0"
commands:
- DEBIAN_FRONTEND=noninteractive apt-get -qq update > /dev/null
- DEBIAN_FRONTEND=noninteractive apt-get -yqq -o=Dpkg::Use-Pty=0 install pkg-config libssl-dev build-essential libsqlite3-dev python3.9 python3.9-venv postgresql postgresql-client mariadb-server mariadb-client zstd lz4 > /dev/null
- pg_ctlcluster 13 main start
- "mysqld_safe &"
- su postgres -c 'createuser root'
- su postgres -c 'createdb -O root testsuitedb'
- psql testsuitedb -c 'CREATE TABLE testsuitetable ();'
- mysql -e 'CREATE DATABASE testsuitemydb; USE testsuitemydb; CREATE TABLE sometable (id INT PRIMARY KEY); INSERT INTO sometable VALUES (42);'
- cargo install -q --path yama
- cargo install -q --path datman
- python3.9 -m venv testsuite/.venv
- ./testsuite/.venv/bin/pip install ./testsuite ./datman-helper-postgres ./datman-helper-mysql
- cd testsuite && . .venv/bin/activate && TEST_POSTGRES=$(hostname),testsuitedb,root TEST_MYSQL=$(hostname),testsuitemydb,root green
when:
event: [push, pull_request]
deployManual:
image: "docker.emunest.net/rei_ci/mdbook:latest-amd64"
pull: true
when:
branch:
- develop
secrets:
- deploy_ssh_key
commands: # warning! Doesn't seem to like hashed known_hosts...
- mdbook build
- echo "$DEPLOY_SSH_KEY" > /tmp/rsync_key
- chmod u=rw,go= /tmp/rsync_key
- rsync -e 'ssh -i /tmp/rsync_key -o "UserKnownHostsFile ./.ci/known_hosts"' -vaz --delete ./book/ space_docs_librepush_net@sallie.librepush.net:./public/yama
- rm /tmp/rsync_key