-
-
Notifications
You must be signed in to change notification settings - Fork 82
124 lines (107 loc) · 3.38 KB
/
Copy pathintegration.yml
File metadata and controls
124 lines (107 loc) · 3.38 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Integration
on:
push:
branches: [master, release/v1]
pull_request:
branches: [master, release/v1]
merge_group:
jobs:
imap-smtp:
name: imap + smtp e2e
runs-on: ubuntu-latest
timeout-minutes: 25
services:
greenmail:
image: greenmail/standalone:2.1.11
ports:
- 3025:3025
- 3110:3110
- 3143:3143
- 3465:3465
- 3993:3993
- 3995:3995
- 8080:8080
env:
GREENMAIL_OPTS: "-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose"
# No --health-cmd: greenmail/standalone image has no wget/curl.
# The runner step below polls /api/service/readiness externally instead.
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.5"
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libpcsclite-dev
- name: Wait for greenmail
run: |
for i in $(seq 1 60); do
if curl -sf http://127.0.0.1:8080/api/configuration >/dev/null; then
echo "greenmail ready"
exit 0
fi
sleep 2
done
echo "greenmail not ready"
curl -v http://127.0.0.1:8080/api/configuration || true
exit 1
- name: Run integration tests
env:
MATCHA_TEST_IMAP_HOST: 127.0.0.1
MATCHA_TEST_IMAP_PORT: "3993"
MATCHA_TEST_SMTP_PORT: "3465"
MATCHA_TEST_API_PORT: "8080"
run: |
go test -v -tags=integration -timeout=10m -count=1 ./tests/integration/...
matrix:
name: cross-platform build matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.5"
- name: Install system deps (linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libpcsclite-dev
- name: Race-enabled unit tests
run: go test -race -timeout=10m ./...
fuzz:
name: short fuzz
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.5"
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libpcsclite-dev
- name: Discover fuzz targets
id: discover
run: |
set -e
targets=$(grep -RIl --include='*_test.go' -E '^func Fuzz' . || true)
echo "found targets:"
echo "$targets"
{
echo "targets<<EOF"
echo "$targets"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Run fuzz targets (30s each)
if: steps.discover.outputs.targets != ''
run: |
for file in ${{ steps.discover.outputs.targets }}; do
dir=$(dirname "$file")
for fn in $(grep -hoE '^func (Fuzz[A-Za-z0-9_]+)' "$file" | awk '{print $2}'); do
echo "=== $dir :: $fn ==="
go test -run=^$ -fuzz="^${fn}$" -fuzztime=30s "./$dir"
done
done