-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.woodpecker.yml
89 lines (83 loc) · 2.94 KB
/
.woodpecker.yml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
steps:
prettier_check:
image: tmknom/prettier:3.2.5
commands:
- prettier -c .
when:
- event: pull_request
build_typescript_plugin:
# need to use ubuntu instead of debian because extism-js requires newer glibc version
# https://github.com/extism/js-pdk/issues/129
image: ubuntu
commands:
- apt-get update && apt-get install -y --no-install-recommends --no-install-suggests node-typescript curl ca-certificates npm
- curl https://github.com/extism/js-pdk/releases/download/v1.4.0/extism-js-x86_64-linux-v1.4.0.gz -L -o extism-js.gz
- gzip -d extism-js.gz
- chmod +x extism-js
- mv extism-js /usr/local/bin/
# for wasm-merge, version in ubuntu repo is too old
- curl https://github.com/WebAssembly/binaryen/releases/download/version_122/binaryen-version_122-x86_64-linux.tar.gz -L -o binaryen.tar.gz
- tar -xvzf binaryen.tar.gz
- mv binaryen-version_122/bin/* /usr/local/bin/
- cd plugins/typescript_push_webhook
- npm install
- npm run build
when:
- event: [pull_request, tag]
build_rust_plugin:
image: rust:1.81
commands:
- rustup target add wasm32-unknown-unknown
- cd plugins/rust_allowed_voters
- cargo build
- cp target/wasm32-unknown-unknown/debug/rust_allowed_voters.wasm ..
when:
- event: [pull_request, tag]
build_go_plugin:
image: tinygo/tinygo:latest
backend_options:
docker:
user: 0:0
commands:
- cd plugins/go_replace_words
- tinygo build -o ../go_replace_words.wasm -target wasip1 -buildmode=c-shared main.go
when:
- event: [pull_request, tag]
run_plugin_tests:
image: node:22-bookworm-slim
environment:
LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432
DO_WRITE_HOSTS_FILE: "1"
commands:
- npm install -g corepack@latest && corepack enable pnpm
- apt-get update && apt-get install -y --no-install-recommends --no-install-suggests bash curl postgresql-client golang curl ca-certificates
# install tinygo to compile wasm plugins
# https://tinygo.org/getting-started/install/linux/#ubuntu-debian
- curl https://github.com/tinygo-org/tinygo/releases/download/v0.36.0/tinygo_0.36.0_amd64.deb -L -o tinygo.deb
- dpkg -i tinygo.deb
- bash tests/prepare.sh
- cd tests/
- pnpm i
- pnpm test
when:
- event: pull_request
publish_plugins:
image: woodpeckerci/plugin-release
settings:
files:
- plugins/rust_allowed_voters.wasm
- plugins/go_replace_words.wasm
- plugins/typescript_push_webhook.wasm
title: ${CI_COMMIT_TAG##v}
api-key:
from_secret: github_token
when:
- event: tag
services:
database:
# 15-alpine image necessary because of diesel tests
image: pgautoupgrade/pgautoupgrade:15-alpine
environment:
POSTGRES_DB: lemmy
POSTGRES_USER: lemmy
POSTGRES_PASSWORD: password